Virtualization system requirements

QEMU version 2.6.2 or later is required to install and launch vESR.

Creating a virtual machine

A virtual machine can be created in several ways.

Launching an image from .qcow2

To launch vESR, you can use the ready-made .qcow2 image from the files supplied with vESR and run the following command:

qemu-system-x86_64 --enable-kvm -cpu host -smp 4 -m 4G -nic tap,ifname=gi1 <disk_name>.qcow2

Note that in this case the ISO image is already pre-installed on the QCow2 disk and has fixed characteristics, which can be checked with the following command:

pc@ubuntu:~$ qemu-img info <disk_name>.qcow2
image: <disk_name>.qcow2
file format: qcow2
virtual size: 400 MiB (419430400 bytes)
disk size: 284 MiB
cluster_size: 65536
Format specific information:
    compat: 1.1
    compression type: zlib
    lazy refcounts: false
    refcount bits: 16
    corrupt: false
    extended l2: false
Child node '/file':
    filename: <disk_name>.qcow2
    protocol type: file
    file length: 284 MiB (297730048 bytes)
    disk size: 284 MiB

The next vESR installation steps are detailed in the vESR installation process section.

After installing vESR, proceed to the Connecting network interfaces section.

Creating a disk image file from .iso

The following example describes how to create a QCow2 disk image file and attach it in the host operating system.

To create a disk image file, run the following command:

qemu-img create -f qcow2 -o size=<disk_size>M <disk_name>.qcow2

Example

qemu-img create -f qcow2 -o size=500M vesr.qcow2

Example output after running the command:

Formatting 'vesr.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=393216000 lazy_refcounts=off refcount_bits=16


Installing vESR

To start the vESR installation, run the following command:

qemu-system-x86_64 --enable-kvm -cpu <CPU> -smp <CPU_count> -m <RAM_size>G -nic tap,ifname=gi1 <disk_name>.qcow2 -boot d -cdrom <ISO_image_name>

where:
--enable-kvm — enables full KVM virtualization support;

-cpu — selects the available CPU;

-smp — enables SMP system emulation with n CPUs;

-m — selects the virtual RAM size;

-nic — network adapter settings;

-boot — boot device selection. The value d specifies CD-ROM;

-cdrom — selects the ISO image file.

Example

qemu-system-x86_64 --enable-kvm -cpu host -smp 4 -m 4G -nic tap,ifname=gi1 vesr.qcow2 -boot d -cdrom vesr-installer.iso


The next vESR installation steps are detailed in the vESR installation process section.

After installation, remove the ISO from the virtual drive. To do this:

  1. Go to the QEMU console using the CTRL+ALT+2 key combination.
  2. Enter the quit exit command.

Subsequent vESR launches must be performed without specifying the ISO.

Example

qemu-system-x86_64 --enable-kvm -cpu host -smp 4 -m 4G -nic tap,ifname=gi1 vesr.qcow2


Connecting network interfaces

To connect a network interface, start vESR on QEMU with the network adapter settings -nic tap,ifname=gi1 (if several network interfaces are required, specify all of them, for example, -nic tap,ifname=gi1 -nic tap,ifname=gi2). On the host device, bring the created interface UP and assign an IP address.

Example

Launching vESR with a single network interface:

qemu-system-x86_64 --enable-kvm -cpu host -smp 4 -m 4G -nic tap,ifname=gi1 vesr.qcow2

Bringing the created interface UP and assigning an IP address:

ip link set gi1 up
ip add add 192.168.1.1/24 dev gi1

Configure the IP addressing on vESR and verify IP connectivity.

vesr# config
vesr(config)# interface gigabitethernet 1/0/1
vesr(config-if-gi)# ip address 192.168.1.2/24
vesr(config-if-gi)# exit
vesr(config)# exit
Warning: you have uncommitted configuration changes.
vesr# commit
Configuration has been successfully applied and saved to flash. Commit timer started, changes will be reverted in 600 seconds.
vesr# confirm
Configuration has been confirmed. Commit timer canceled.
vesr# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56 bytes of data.
!!!
--- 192.168.1.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 0.150/0.223/0.313/0.069 ms

vESR now has direct IP connectivity with the host, enabling Telnet and SSH access to vESR, as well as vESR firmware updates, file uploads, and file downloads.

Connecting a serial port (optional)

The settings in this section are optional and do not affect system operation.

To connect the vESR serial port to a host pty, add the following option to the QEMU emulator launch command:

-serial pty

After running the command, a line with the pty number to which the output is redirected will appear:

char device redirected to /dev/pts/3 (label serial0)

Command to connect to the pty using minicom:

minicom -D /dev/pts/3

Alternatively, the vESR serial port can be connected to a pipe in the host file system. To do this, add the following option:

-serial unix:/tmp/vesr-qemu,server,nowait

Command to connect to the pipe using minicom:

minicom -D unix#/tmp/vesr-qemu
  • Нет меток