QEMU and virt-manager setup

This is a brief tutorial to help install QEMU and virt-manager to run different OS's in a virtual environment.

In preparation download your ISO files for Linux, utilities or Raspberry Pi etc.

Install the required packages.

sudo apt install -y qemu-kvm libvirt-daemon-system virt-manager

Log out and back in again, otherwise you get an error in virt-manager.

virt-manager-no-access-before-logout

Run Virtual Machine Manager from the menu or run virt-manager from the terminal window.

Optional: Move default disk location to a different disk

You can either add a new pool or replace the default pool.

If you add a new storage pool then you will have to remember to use it when creating volumes.
Otherwise, if you replace the default pool then virt-manager will automatically use it.

It is suggested that you recreate the default pool and move VMs onto a separate volume and not store them on the root partition.

I have a separate disk /data and have created two folders:

/data/vm - To store VMs
/data/iso - To store ISO files

Edit->Connection Details->Storage

Stop and delete the default storage pool.

Add new storage pool, give it a name, e.g. default.

add-storage-1-name

Set the Target Path to /data/vm.

add-storage-2-target-path

You now have a new default storage pool.

Set it to autostart on boot and Apply and close the Connection Details Window.

Now we are in a position to create a new VM.

Click on the Create New Virtual Machine icon or New->Virtual Machine.

Keep the default, Local install media (ISO Image or CDROM).

new-virtual-machine-1-media

Select Use ISO image.

Click on Browse, then click on Browse Local and locate your ISO.

new-virtual-machine-2-browse-iso

Specify the amount of memory and CPU to give the new VM.

new-virtual-machine-3-mem-cpu

Specify the disk size.

new-virtual-machine-4-disk

Give your new VM a meaningful name (this is used for the file names as well).

new-virtual-machine-5-name

Either click Finish and your VM will automatically start or click Customise configuration before install to alter any additional settings.

If the screen goes blank in the VM then choose Send Key->Ctrl+Alt+Backspace to view the boot messages.

After a while you should see your desktop in the VM.

From there, dependant upon what ISO you are running you can continue to install your OS etc.

5 Likes

Hi

I keep running into this error when trying to install the required packages. I've tried looking around for a solution online but I'm not sure what to do.

The following packages have unmet dependencies:
qemu-kvm : Depends: qemu-system-x86 (= 1:4.2-3ubuntu6.21) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Make sure you have updated your system first:

sudo apt update

And try again. If this doesn't work, you can try to install that missing package directly:

sudo apt install qemu-system-x86

If this works then proceed with the rest of the packages.

1 Like

I don't install Qemu as a package (in Devuan I need to state - I am not running Zorin), just Virtual Machine Manager via Synaptic. I created a folder named 'Storage' in my /home folder and point Virt Manager to their for my images. The default is usually a folder in /etc that can soon get clogged up, so better creating a storage folder either in home or on an external/ alternate internal drive.
I'd also recommend backing up your images to an external drive should things go wrong. Since my last failing hard drive, I have had a few issues running the updated Windows 7 to Windows 8.1 .img - solution? Just delete the .qcow image but NOT the main .img file.

1 Like

Other things to be mindful of when using Virt Manager (Virtual Machine Manager).
If you want access to USB sticks plugged in to the host, you need to add these manually on the details page of the VM:

I have been having issues of not seeing the splash screen correctly of Zorin - had to change the Display details to 'virtio' in Machine Details:

So now I get the glowing 'Z' on boot but the login screen is still 4:3 for some reason and centred!

Useful guide on how to change default location of images. If you let virt-manager use the default location (which occurred when I was reinstalling virt-manager after downgrading to Devuan 3.1.1 from 4.0) it chose /var/lib/libvirt/images

These has a serious impact on your '/' file system as I discovered yesterday when I could not install anything else as I was out of space! Reason? 3 images taking up 60 Gb of 80 Gb /root! The images were too big to send to Rubbish Bin so had to move them to my /home folder, logging in as root with root account in order to do this. I don't know if you would have success in Zorin as it seems to hide 'root' completely with no known password. It does this for security reasons but could be troublesome if you needed to do what i have had to do in Devuan (which I am now looking to move away from - why? elogind which is part of the systemd malarchy!)

1 Like

Help installation correct way W11

@jgordon starting from Zorin 17 logging out wasn't fixing the Virtual Machine Manager Connect Failure restarting the os does