io7m | single-page | multi-page
3.23. vm-realize
Previous
3. Command-Line Interface
Up
3.25. vm-set
Next
3.24

# vm-run

- 3.24. vm-run
  - 3.24.1. Name
  - 3.24.2. Description
  - 3.24.3. Example

3.24.1

## Name

1
vm-run - Start a virtual machine
3.24.2

## Description

1
The vm-run command starts a virtual machine. The command, internally, uses execve() to replace the waxmill process with that of the bhyve virtual machine. The virtual machine stays running in the foreground. The command is intended to be used to start virtual machines under process supervision systems such as daemontools or runit.
2
The vm-run command will, when executed, will first generate and write the necessary configuration files into the virtual machine runtime directory for the given machine, and then generate and execute the necessary shell commands to start the virtual machine. For example, if the selected boot configuration uses GRUB bhyve, the required grub.cfg and device.map files will be generated and saved into the directory. The --dry-run option will cause the command to generate those required files, but will display the shell commands necessary to start the virtual machine on the standard output instead of actually executing them.
3

### 3.24.2.3 Parameters

Parameter | Type | Required | Description
--- | --- | --- | ---
--boot-configuration | Boot Configuration | true | The name of the boot configuration that will be used.
--configuration | Path | false | The path to the configuration file (environment variable: $WAXMILL_CONFIGURATION_FILE)
--dry-run | Boolean | false | Show the commands that would be executed, but do not execute them.
--machine | UUID | true | The ID of the virtual machine
--verbose | Log Level | false | Set the minimum logging verbosity level.

3.24.3

## Example

1

### 3.24.3.1 Example

    (Formatted for legibility)

    $ waxmill vm-run \
      --machine 538a90e4-d50d-4511-8643-ae418279bac4 \
      --boot-configuration install \
      --dry-run true

    /usr/local/sbin/grub-bhyve \
      --device-map=/zroot/storage/vm/538a90e4-d50d-4511-8643-ae418279bac4/grub-device.map \
      --root=host \
      --directory=/zroot/storage/vm/538a90e4-d50d-4511-8643-ae418279bac4 \
      --memory=250M \
      538a90e4-d50d-4511-8643-ae418279bac4

    /usr/sbin/bhyve \
      /home/rm/git/com.github/io7m/waxmill/bhyve \
      -P \
      -A \
      -H \
      -c cpus=1,sockets=1,cores=1,threads=1 \
      -m 250M \
      -s 0:0:0,hostbridge \
      -s 0:1:0,ahci-hd,/zroot/storage/vm/538a90e4-d50d-4511-8643-ae418279bac4/disk-0_1_0 \
      -s 0:2:0,ahci-cd,/tmp/openbsd-6.6-amd64.iso \
      -s 0:3:0,lpc \
      -l com1,/dev/nmdm_538a90e4-d50d-4511-8643-ae418279bac4_B \
      -s 0:4:0,virtio-net,tap23,mac=a3:26:9c:74:79:34 \
      538a90e4-d50d-4511-8643-ae418279bac4

3.23. vm-realize
Previous
3. Command-Line Interface
Up
3.25. vm-set
Next
io7m | single-page | multi-page