Skip to content

Latest commit

 

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bhyvemgrd

Bhyvemgrd exposes a JSON-based IPC interface over a UNIX domain socket, allowing the bhyvemgr client to request privileged operations required for bhyve virtual machines, execute system-level tasks, monitor VM process states, and receive asynchronous state notifications. Currently it supports amd64 and aarch64 on FreeBSD.

Dependencies

Almost all FreeBSD versions have a complete support for use mdo tool and mac_do. Bhyvemgrd uses mac_do/mdo or since 1.1.0 mac_do/setcred/exec_paths for execute commands with root credentials but it runs using an unpriviliged user. By default, bhyvemgrd port adds an user (bhyvemgrd/833) and group (bhyvemgrd/833) so it must be used to define the mac_do rules.

mac_do/mdo setting

# kldload mac_do
# sysctl security.mac.do.rules="uid=833>uid=0,gid=0,+gid=*"

If you want to do these settings persistent, add the following lines:

# ee /boot/loader.conf
mac_do_load=YES
# ee /etc/sysctl.conf
security.mac.do.rules="uid=833>uid=0,gid=0,+gid=*"

If you want to do these settings persistent, add the following lines:

# ee /boot/loader.conf
mac_do_load=YES
# ee /etc/sysctl.conf
security.mac.do.rules="uid=833>uid=0,gid=0,+gid=*"

Enable it editing daemon.conf file

# ee /usr/local/etc/bhyvemgrd/daemon.conf
root_mode=mdo

mac_do/setcred/exec_paths setting (only for FreeBSD >= 1501501)

# kldload mac_do
# sysctl security.mac.do.rules="uid=833>uid=0,gid=0,+gid=*"
# sysctl security.mac.do.exec_paths="/usr/bin/mdo:/usr/local/sbin/bhyvemgrd"

If you want to do these settings persistent, add the following lines:

# ee /boot/loader.conf
mac_do_load=YES
# ee /etc/sysctl.conf
security.mac.do.rules="uid=833>uid=0,gid=0,+gid=*"
security.mac.do.exec_paths="/usr/bin/mdo:/usr/local/sbin/bhyvemgrd"

Enable it editing daemon.conf file

# ee /usr/local/etc/bhyvemgrd/daemon.conf
root_mode=setcred

Additional modules

The vmm and nmdm modules are other dependencies, but these can be loaded by bhyvemgrd automatically if previous settings are defined. Otherwise, you can put the following lines in your /boot/loader.conf:

# ee /boot/loader.conf
vmm_load=YES
nmdm_load=YES

or

# kldload vmm nmdm

Finally, the bhvemgrd needs two configuration files to run: daemon.conf and common.conf. The first is installed by bhyvemgrd port and the last one is created by bhyvemgr GUI on first time and it only contains vm_path setting. The vm_path defines the path where virtual machines files are stored in your system. Both files are stored at /usr/local/etc/bhyvemgrd directory.

# service bhyvemgrd enable
# service bhyvemgrd start

Notes

  • The bhyvemgrd daemon only can be used by bhyvemgr >= 2.0.0
  • Start bhyvemgrd service only after bhyvemgr generated gui.conf and common.conf files. Othwerwise, it will not start. Look at /var/log/bhyvemgrd.log for the reason
  • Changes in /usr/local/etc/bhyvmgrd/daemon.conf can be reload using service bhyvemgrd reload
  • A service bhyvemgrd restart is not allowed if you have virtual machines running in that time
  • Don't forget add the user that you use for run bhyvemgr GUI to bhyvemgrd group pw groupmod bhyvemgrd -m your_user

About

Privileged helper daemon for bhyvemgr

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages