How to start with virt-manager

Hello André.

I had the same initial issue you initially had when creating a Win 10 Enterprise VM on Fedora 40 VirtualBox 7.0.20. I have now managed to get the virtual machine working on Virtualbox.

However, now I would like to see if I can get better performance and usability by creating this VM using virt-manager.
Please let me know if you have instructions that would tell me how to do that?

I saw this instructions here:

However, these seem old and they don’t appear to be specific to Windows.

I also found these instructions here:
https://dennisnotes.com/note/20180614-ubuntu-18.04-qemu-setup/
These seem more up to date and specific. Do you think I can get this working by following these instructions?
The storage setup here seems overly complicated. Do you think I need to follow the steps indicated there?

Could you provide instructions to get Win 10 working with virt-manager?

thanks

I made a new topic because it was off topic and or an old one.

About your question how to start with virt-manager is quite simple:

sudo dnf group install virtualization

Open the virt-manager and try to create a new virtual environment.

Our doc about virtualization needs review. So you might have a look for other tutorials/manuals.

The below looks quite new. As it is written for Debian you can continue by step 4 as the installation is done with the command above.

1 Like

You could also converting your virtualbox vm to virt-manager:
Converting Windows VM from VirtualBox to virt-manager – Random Musings

This probably isn’t what the OP is looking for, however, I recently set this up on my Sway workstation using the following settings (I also use systemd-networkd for networking).

network config

[glb@localhost ~]$ cat /etc/systemd/network/00-vlan0.netdev
[NetDev]
Name=vlan0
Kind=macvlan

[MACVLAN]
Mode=bridge

[glb@localhost ~]$ cat /etc/systemd/network/00-vtap0.netdev
[NetDev]
Name=vtap0
Kind=macvtap

[MACVTAP]
Mode=bridge

[glb@localhost ~]$ cat /etc/systemd/network/50-link0.network
[Match]
PermanentMACAddress=aa:bb:cc:dd:ee:ff

[Link]
RequiredForOnline=carrier
ARP=no

[Network]
LinkLocalAddressing=false
MACVLAN=vlan0
MACVTAP=vtap0

[glb@localhost ~]$ cat /etc/systemd/network/90-vlan0.network
[Match]
Name=vlan0

[Network]
DHCP=yes

[glb@localhost ~]$ cat /etc/systemd/network/90-vtap0.network
[Match]
Name=vtap0

[Link]
ActivationPolicy=always-up
RequiredForOnline=carrier

[Network]
LinkLocalAddressing=false
ConfigureWithoutCarrier=true

udev config

[glb@localhost ~]$ cat /etc/udev/rules.d/90-macvtap.rules 
SUBSYSTEM=="macvtap", OWNER="glb", GROUP="root", MODE="0660"

[glb@localhost ~]$ cat /etc/udev/rules.d/90-zvolume.rules
KERNEL=="zd0", OWNER="glb", GROUP="disk", MODE="0660"

script to launch windows

[glb@localhost ~]$ cat ~/bin/windows
#!/usr/bin/bash

# The $PORT, $OVMF, $DISK, and $VTAP variables
# should be unique for each VM.
# You can make duplicate copies of this script
# to run each VM.
# Or you could rewrite this script to take the
# four values as parameters.

# spice port for graphics
PORT="5634"

OVMF="$HOME/.local/opt/windows"
if ! [[ -e $OVMF ]]; then
	mkdir -p "$OVMF"
	for image in OVMF_{CODE,VARS}.fd; do
		cp "/usr/share/edk2/ovmf/$image" "$OVMF"
	done
fi

DISK="/dev/zd0"

VTAP="vtap0"
exec {fd}<>"/dev/tap$(</sys/class/net/$VTAP/ifindex)"

qemu-system-x86_64 \
	-name windows \
	-m 8g -cpu host -smp 4 \
	-machine type=q35,accel=kvm,vmport=off \
	-vga qxl \
	-display spice-app \
	-spice "disable-ticketing=on,addr=127.0.0.1,port=$PORT" \
	-chardev spicevmc,id=c1,name=vdagent \
	-netdev "tap,fd=$fd,id=$VTAP" \
	-device virtio-rng-pci \
	-device virtio-serial-pci \
	-device virtserialport,id=c1,chardev=c1,name=com.redhat.spice.0 \
	-device "virtio-net-pci,netdev=$VTAP,mac=$(</sys/class/net/$VTAP/address)" \
	-drive "if=pflash,format=raw,unit=0,file=$OVMF/OVMF_CODE.fd,readonly=on" \
	-drive "if=pflash,format=raw,unit=1,file=$OVMF/OVMF_VARS.fd" \
	-drive "file=$DISK,format=raw"

sway config

[glb@localhost ~]$ cat ~/.config/sway/config | grep 'exec windows$\|remote-viewer\|pointer_constraint'
# release mouse pointer workaround: https://github.com/swaywm/sway/issues/8153#issuecomment-2104657092
bindsym --no-repeat --inhibited $mod+x seat * pointer_constraint escape
for_window [app_id="^(?i)remote-viewer$"] move container to workspace 6, workspace 6, fullscreen enable
bindsym $mod+Shift+w exec windows

Anyone wanting to replicate that configuration would need to tweak a few things for their PC. The OVMF_CODE.fd and OVMF_VARS.fd come with the edk2-ovmf package. You’ll need to change the udev rules to grant your account access to the hard drive and network device. (/dev/zd0 is a ZFS volume that I created to contain my Windows image.)

[glb@localhost ~]$ zfs list -r root/windows
NAME                  USED  AVAIL  REFER  MOUNTPOINT
root/windows         66.4G  48.9G  25.7G  -
root/windows@000010  3.25G      -  25.7G  -

To install Windows, you need to add -drive file=<windows iso image>,media=cdrom -boot d to the end of the qemu-system-x86_64 ... line in the ~/bin/windows script. Remove those options after you’ve installed Windows so QEMU will boot from the hard drive.

You’ll need to install the qemu-system-x86-core to get QEMU and the virt-viewer package to get the Spice client (maybe spice-vdagent, qemu-ui-spice-core and qemu-ui-spice-app as well). Also, there are some Spice guest tools for Windows that will allow copy-and-paste to work between your Windows image and your Fedora Linux host. I’ll see if I can find where I got those …

It looks like I got the spice guest tools for Windows from here: https://www.spice-space.org/download/binaries/spice-guest-tools/spice-guest-tools-latest.exe

Thanks for the quick reply.
I will try to follow those instructions.

Sway seems very complicated, I won’t try that for now.

I am still wondering if installing the Spice guest additions is always necessary?

thanks

2 Likes