|  | 
   
 |   |  |   
  
    | BVM(8) | FreeBSD System Manager's Manual | BVM(8) |  
bvm— Bhyve
    Virtual machines Management tool
 
 
 
  
    | bvm | --createname
      [fromtemplate-name] |  
 
 
 
 
 
  
    | bvm | --ls[byname |
      byos | bystatus |
      online] |  
 
  
    | bvm | --ll[byname |
      byip | byos |
      bystatus | online] |  
 
 
 
 
 
 
  
    | bvm | --clonename new-name |  
 
 
  
    | bvm | --renamename
      new-name |  
 
 
 
 
 
 
 
 
 
 
 
 
 
  
    | bvm | --setswSwitch
      ip/mask |  
 
 
 
 
 
 
 
 
 
 
 
 The bvmis 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
    corresponding configuration file and can be modified by the
    bvmcreate one or more
    bridge(4)
    devices for each virtual switch and dynamically assign them to the virtual
    machine
    tap(4)
    interface. When the virtual machine is shut down normally, thebvmwill automatically clean up the useless network
    devices. The bvmsupports 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. Once bvmis 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 If you want to automatically boot the specified list of virtual
    machines in order while the host is booting, add the following lines to
    /etc/rc.conf to enable: 
  --abinfoShow information for all auto-bootstrap virtual machines.--addisknameAdd a hard disk to the virtual machine.--autobootStart the automatic booting virtual machine in order. Boot option, 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 administrator-set virtual machine can be
      automatically started by the rc script. The method is to use
      bvm--configto modify the
      default value of the auto boot menu to yes.In self-start mode, bvmwill 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 tentative 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 prioritized, it may
        cause the web service to be abnormal! The correct way to use this option is to add the startup
        script:--clonename new-nameClone a new virtual machine from an existing virtual machine.--confignameEdit 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.
    
      cpusThe number of CPUs (non-cores) used by the current virtual
        machine.ramThe size of the memory requested by the current virtual machine, the
          unit of which can be M/G, etc.iso pathThe directory where the iso disc image is located (is the directory,
          non-iso absolute address). When the directory is specified,
          bvmwill automatically list the iso files
          contained in the current directory. The user can select the menu
          number.boot fromThis is an important option. When the system is first installed,
          bvmwill automatically adjust this option to
          hd0 for system startup. When you need to use iso disc for system
          maintenance, you can change this option to cd0.uefiThis option is mostly used by the operating system that installs the
          graphical interface. It needs to be used with VNC to get the desktop.
          In addition, this option will invalidate the
          --loginoption because--loginis a text console and does not have
          graphical interface operating conditions.auto bootSee --autobootfor details.hostbridgeThis 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 configThe 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--addiskshortcut command.network configThis option allows you to configure the networking or networking of
          virtual machines.--createname [fromtemplate-name]Create a new virtual machine.
    
    # bvm --create vm1
# bvm --create vm2 from vm1--deldisknameDelete the disks in the virtual machine.--decryptnameDecrypt the virtual machine.--encryptnameEncrypt the virtual machine.--helpShow all options and descriptions.--loginnameLogin 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.
    
      bynameOutput list in ascending order by name.byosOutput list in ascending order by OS.bystatusOutput list in ascending order by virtual machine status.onlineOnly 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: 
      NAMEThe name of the virtual machine.GUESTVirtual machine operating system.CPUNumber of CPUs.MEMORYSize of memory.DISKDisk capacity, the number in square brackets represents the number of
          disks, and the capacity is the sum of all disk capacities.STATEThe 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.
    
      bynameOutput list in ascending order by name.byipOutput list in ascending order by IP-addr.byosOutput list in ascending order by OS.bystatusOutput list in ascending order by virtual machine status.onlineOnly show running virtual machines. The added list items have the following meanings: 
      IPThe IP address of the virtual machine.LOADERThe boot loader for the virtual machine.AUTOSTARTThe state in which the virtual machine is automatically started,
          "Yes" is automatically started, and the number next to it is
          the startup sequence.--locknameLocks 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.--lockallLock all virtual machines, behaving the same as
      --lock.--netstatShow all network configuration information of virtual machines, including
      NIC, mode, IP address, gateway, port forwarding, bridge, and TAP device,
      etc.--osShow a list of operating systems supported by
    bvm.--poweroffnameForce 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-natReload the NAT port redirect. In general, you do not need to use this
      option, bvmwill automatically handle port
      redirection, this option is manual mode.--removenameDestroy a virtual machine and it cannot be recovered. Note that the
      virtual machine cannot be running when you run this command.--renamename new-nameRename the virtual machine.--restartnameRestart a virtual machine.--rollbacknameRoll back to the snapshot point.--setnatnat ip/maskSet the IP address and mask of the NAT.
    
    # bvm --setnat nat0 172.16.1.1/24--setpripPort redirection is set dynamically with immediate effect. In general, the
      virtual machine must be turned off to set the virtual machine parameters,
      but this option can set the port redirection at any time in the virtual
      machine on state, and take effect immediately.
    
    # bvm --setpr 10.10.30.10--showprShow 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--setswswitch ip/maskSet the ip address and mask of the virtual switch. The same method as
      --setnat.--showdevSelect a network device and show its relationship to the virtual machine
      NIC.--showdevallShow a relationship table for all network devices.--showdevuseShow a relational table of all network devices in use.--showdhcpShow all DHCP clients.--showsnapnameShow snapshots list of the virtual machine.--showsnapallShow snapshots list of the all virtual machines.--showstatsnameShow the statistics of the virtual machine.--snapshotnameGenerating snapshots for the virtual machine.--startnameStart a virtual machine.--stopnameShut down a virtual machine.--unlocknameUnlock a virtual machine.--unlockallUnlock all virtual machines.--unsetswswitchDelete the IP address of the virtual switch.--versionShow the version number of bvminstalled.--vminfonameShows the configuration of the virtual machine. /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. 
  Visit the GSP FreeBSD Man Page Interface. Output converted with ManDoc.
 |