FreeBSD Manual Pages
BVM(8) System Manager's Manual BVM(8) NAME bvm -- Bhyve Virtual machines Management tool SYNOPSIS bvm --help bvm --version bvm --create name [from template-name] bvm --config name bvm --vminfo name bvm --showstats name bvm --os bvm --ls [byname | byos | bystatus | online] bvm --ll [byname | byip | byos | bystatus | online] bvm --login name bvm --start name bvm --restart name bvm --stop name bvm --poweroff name bvm --clone name new-name bvm --remove name bvm --rename name new-name bvm --encrypt name bvm --decrypt name bvm --lock name bvm --unlock name bvm --lockall bvm --unlockall bvm --addisk name bvm --deldisk name bvm --abinfo bvm --autoboot bvm --reload-nat bvm --setnat Nat ip/mask bvm --setsw Switch ip/mask bvm --unsetsw Switch bvm --setpr ip bvm --showpr bvm --showdhcp bvm --showdev bvm --showdevuse bvm --showdevall bvm --snapshot name bvm --rollback name bvm --showsnap name bvm --showsnapall bvm --netstat DESCRIPTION The bvm is a bhyve(8) virtual machine management tool based on FreeBSD that allows you to easily manage virtual machines. The virtual machine's network is handled by one or more virtual switches. Each switch has a simple name, which is stored in the corre- sponding configuration file and can be modified by the bvm create one or more bridge(4) devices for each virtual switch and dynamically as- sign them to the virtual machine tap(4) interface. When the virtual ma- chine is shut down normally, the bvm will automatically clean up the useless network devices. The bvm supports multiple network cards and multiple hard disks. Each virtual machine can have multiple network cards or multiple hard disks, and can easily add, delete, and modify network cards or hard disks. BASIC SETUP Once bvm is installed, the first thing you have to do is set up the virtual machine's storage directory. Edit the value of vmdir in /usr/local/etc/bvm/bvm.conf vmdir=/your/vm/dir/ If you want to automatically boot the specified list of virtual ma- chines in order while the host is booting, add the following lines to /etc/rc.conf to enable: bvmd_enable="YES" OPTIONS --abinfo Show information for all auto-bootstrap virtual machines. --addisk name Add a hard disk to the virtual machine. --autoboot Start the automatic booting virtual machine in order. Boot op- tion, which is usually not required in administrator manual maintenance mode. Sometimes the host is powered on again after shutdown or unexpected downtime. At this time, the administra- tor-set virtual machine can be automatically started by the rc script. The method is to use bvm --config to modify the default value of the auto boot menu to yes. In self-start mode, bvm will refer to the boot level and delay options of vm. The boot level is the boot priority. When there are multiple self-starting virtual machines, the lower the startup priority, the more the virtual machine starts. Back to front. Boot time (boot time) After starting the current virtual machine, it can also be said that the number of seconds is ten- tative before starting the next virtual machine. The reason for designing these two parameters is because some services may need to be activated first to ensure normal business. For example, the relationship between the database and the web service, if the data virtual machine library is not priori- tized, it may cause the web service to be abnormal! The correct way to use this option is to add the startup script: # sysrc bvmd_enable=yes --clone name new-name Clone a new virtual machine from an existing virtual machine. --config name Edit the configuration of the virtual machine. This option needs to be used in the case of a virtual machine. Options that allow users to configure independently are: cpus, ram, iso path, boot from, hostbridge, uefi, auto boot, disk config, and network config. cpus The number of CPUs (non-cores) used by the current virtual machine. ram The size of the memory requested by the cur- rent virtual machine, the unit of which can be M/G, etc. iso path The directory where the iso disc image is located (is the directory, non-iso absolute address). When the directory is specified, bvm will automatically list the iso files contained in the current directory. The user can select the menu number. boot from This is an important option. When the system is first installed, bvm will automatically adjust this option to hd0 for system startup. When you need to use iso disc for system maintenance, you can change this op- tion to cd0. uefi This option is mostly used by the operating system that installs the graphical inter- face. It needs to be used with VNC to get the desktop. In addition, this option will invalidate the --login option because --login is a text console and does not have graphical interface operating conditions. auto boot See --autoboot for details. hostbridge This is a schema attribute whose attribute value should be hostbridge when using the Intel system CPU; its attribute value should be amd_hostbridge when using the AMD series CPU. disk config The option can add or delete the hard disk of the current virtual machine. If you only want to add the hard disk, it is recommended to use bvm --addisk shortcut command. network config This option allows you to configure the net- working or networking of virtual machines. --create name [from template-name] Create a new virtual machine. # bvm --create vm1 # bvm --create vm2 from vm1 --deldisk name Delete the disks in the virtual machine. --decrypt name Decrypt the virtual machine. --encrypt name Encrypt the virtual machine. --help Show all options and descriptions. --login name Login to a running virtual machine from console, the boot loader of this virtual machine must be grub, and the uefi mode needs to log in using the VNC client. --ls [byname | byos | bystatus | online] Show a list and status of all virtual machines. By default, the output is sorted in ascending order by name, or one of the following options is specified. byname Output list in ascending order by name. byos Output list in ascending order by OS. bystatus Output list in ascending order by virtual machine status. online Only show running virtual machines. # bvm --ls byos NAME GUEST CPU MEMORY DISK STATE c Debian 1 512M [2]5.5G off d Debian 1 512M [1]5G off * abc Debian 1 512M [1]10G on b FreeBSD 1 1G [1]10G off bb FreeBSD 1 1G [1]10G off # bvm --ls NAME GUEST CPU MEMORY DISK STATE abc Debian 1 512M [1]10G on b FreeBSD 1 1G [1]10G off bb FreeBSD 1 1G [1]10G off c Debian 1 512M [2]5.5G off d Debian 1 512M [1]5G off * The meaning of the list items is as follows: NAME The name of the virtual machine. GUEST Virtual machine operating system. CPU Number of CPUs. MEMORY Size of memory. DISK Disk capacity, the number in square brackets represents the number of disks, and the ca- pacity is the sum of all disk capacities. STATE The state of the virtual machine, off or on, if the virtual machine is locked, a yellow symbol '*' is also displayed, if the virtual machine is encrypted, a red symbol '*' is also displayed. --ll [byname | byip | byos | bystatus | online] Show a list and status of all virtual machines in long format. By default, the output is sorted in ascending order by name, or one of the following options is specified. byname Output list in ascending order by name. byip Output list in ascending order by IP-addr. byos Output list in ascending order by OS. bystatus Output list in ascending order by virtual machine status. online Only show running virtual machines. The added list items have the following meanings: IP The IP address of the virtual machine. LOADER The boot loader for the virtual machine. AUTOSTART The state in which the virtual machine is automatically started, "Yes" is automati- cally started, and the number next to it is the startup sequence. --lock name Locks the specified virtual machine, and can't --config , --remove , --start , and so on. Only simple read operations can be performed, such as --vminfo , --ls , this option also prevents the risk of virtual machine files being accidentally deleted. --lockall Lock all virtual machines, behaving the same as --lock. --netstat Show all network configuration information of virtual machines, including NIC, mode, IP address, gateway, port forwarding, bridge, and TAP device, etc. --os Show a list of operating systems supported by bvm. --poweroff name Force the virtual machine to power off. When there are some special reasons that prevent the virtual machine from shutting down properly, you need to use this option to force the virtual machine to power off. --reload-nat Reload the NAT port redirect. In general, you do not need to use this option, bvm will automatically handle port redirec- tion, this option is manual mode. --remove name Destroy a virtual machine and it cannot be recovered. Note that the virtual machine cannot be running when you run this command. --rename name new-name Rename the virtual machine. --restart name Restart a virtual machine. --rollback name Roll back to the snapshot point. --setnat nat ip/mask Set the IP address and mask of the NAT. # bvm --setnat nat0 172.16.1.1/24 --setpr ip Port redirection is set dynamically with immediate effect. In general, the virtual machine must be turned off to set the vir- tual machine parameters, but this option can set the port redi- rection at any time in the virtual machine on state, and take effect immediately. # bvm --setpr 10.10.30.10 --showpr Show all list of port redirect. # bvm --showpr PROTO VM IP:PORT HOST PORT VM NAME tcp 172.16.1.10:22 2224 freebsd-14 tcp 172.16.1.10:80 8080 freebsd-14 udp 192.168.1.254:53 9953 abc tcp 10.10.30.10:22 3322 ob --setsw switch ip/mask Set the ip address and mask of the virtual switch. The same method as --setnat. --showdev Select a network device and show its relationship to the vir- tual machine NIC. --showdevall Show a relationship table for all network devices. --showdevuse Show a relational table of all network devices in use. --showdhcp Show all DHCP clients. --showsnap name Show snapshots list of the virtual machine. --showsnapall Show snapshots list of the all virtual machines. --showstats name Show the statistics of the virtual machine. --snapshot name Generating snapshots for the virtual machine. --start name Start a virtual machine. --stop name Shut down a virtual machine. --unlock name Unlock a virtual machine. --unlockall Unlock all virtual machines. --unsetsw switch Delete the IP address of the virtual switch. --version Show the version number of bvm installed. --vminfo name Shows the configuration of the virtual machine. CONFIGURE FILES /usr/local/etc/bvm/bvm.conf This file records the virtual machine's directory and a list of all supported operating systems. /usr/local/etc/bvm/nat.conf This file records the configuration information for all NAT. nat0=172.16.1.1/24 nat1=10.10.30.1/24 nat2=192.168.1.1/24 /usr/local/etc/bvm/switch.conf This file records the configuration information of all virtual switches. The default 0-2 sets the IP address, and 3-7 is not set. switch0=10.0.1.0/24 switch1=10.0.2.0/24 switch2=10.0.3.0/24 switch3= switch4= switch5= switch6= switch7= /usr/local/etc/bvm/dhcp.conf This file records DHCP configuration information, including lease time, DNS, IP address pool, etc. SEE ALSO tmux(1), bridge(4), tap(4), bhyve(8), bhyveload(8), zfs(8) BUGS Please report all bugs/issues/feature requests to the GitHub project at https://github.com/bigdragonsoft/bvm AUTHORS Qiang Guo <bigdragonsoft@gmail.com> FreeBSD Ports 14.quarterly December 26, 2024 BVM(8)
NAME | SYNOPSIS | DESCRIPTION | BASIC SETUP | OPTIONS | CONFIGURE FILES | SEE ALSO | BUGS | AUTHORS
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=bvm&sektion=8&manpath=FreeBSD+Ports+14.3.quarterly>
