Skip to content

Creating a KVM Virtual Machine

If this is your first time dealing with KVM, VSI recommends that you start by copying and pasting the commands from the CLI examples in the sections below.

Before you begin setting up your KVM virtual machine:

  1. Review the requirements and recommended settings for your KVM virtual machine discussed in OpenVMS on KVM Prerequisites.
  2. Download the VSI OpenVMS OE ISO file from the VSI Service Portal.
  3. Configure a network bridge. For instructions on how to do so, refer to the Configuring and managing networking guide.

The command below will create a working virtual machine configuration depending on your version of VSI OpenVMS for x86-64.

Copy the command and use your values for the parts in bold.

bridgemac="bridge-interface-mac"
vmname="virtual-machine-name"
vmdesc="virtual-machine-description"
isopath="/path/to/vms/install.iso"
diskpath="/path/to/vms/disk.qcow2"
bridgename="network-bridge-name"
sudo virt-install \
--name $vmname \
--description $vmdesc \
--memory=8192 \
--vcpus=4 \
--cpu host-model \
--controller type=scsi,model=virtio-scsi \
--disk device=cdrom,path=$isopath,bus=sata \
--disk path=$diskpath,\
size=30,bus=scsi,cache=writethrough,sparse=no \
--network=bridge:$bridgename,mac=$bridgemac,model='virtio-net' \
--machine q35 \
--os-variant none \
--boot fd \
--boot loader=/usr/share/OVMF/OVMF_CODE.secboot.fd,loader.readonly=yes,\
loader.type=pflash,loader_secure=yes \
--features vmport.state=off,smm.state=on \
--watchdog model=itco,action=none \
--serial pty \
--noreboot \
--autostart

Copy the command and use your values for the parts in bold.

bridgemac="bridge-interface-mac"
vmname="virtual-machine-name"
vmdesc="virtual-machine-description"
isopath="/path/to/vms/install.iso"
diskpath="/path/to/vms/disk.qcow2"
bridgename="network-bridge-name"
sudo virt-install \
--name $vmname \
--description $vmdesc \
--memory=8192 \
--vcpus=4 \
--cpu host-model \
--controller type=scsi,model=virtio-scsi \
--disk device=cdrom,path=$isopath,bus=sata \
--disk path=$diskpath,\
size=30,bus=scsi,cache=writethrough,sparse=no \
--network=bridge:$bridgename,mac=$bridgemac,model='virtio-net' \
--machine q35 \
--os-variant none \
--boot fd \
--boot loader=/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd,\
loader.readonly=yes,loader.secure=yes,loader.type=pflash,\
nvram.template=/usr/share/edk2/ovmf/OVMF_VARS.secboot.fd \
--features vmport.state=off,smm.state=on \
--watchdog model=itco,action=none \
--serial pty \
--noreboot \
--autostart

For a detailed description of the virt-install command used in the examples above, along with the recommended settings and alternatives that may depend on your system requirements, refer to virt-install Command Reference.

For the full documentation on the virt-install command, run the following:

man virt-install

After the virt-install is executed, your virtual machine will be installed and configured, but will not be running.

In order to start the virtual machine instance, run:

sudo virsh start vm-name

Attention

If you are an unprivileged user, perform the steps described in Interacting with a VM as an Unprivileged User before you start using your KVM virtual machine.

Caution

VSI does not recommend creating new virtual machines using the Cockpit GUI, as necessary customization options are not available there. However, this can be an easy way to manage your virtual machines once they are created. See KVM Configuration Methods for detatils.