This post documents my setup and configuration notes for running virtual machines with QEMU and VirtManager on Linux. It covers:
- Shared folder configuration.
- Physical disk passthrough.
- Bridge networking setup.
- Windows guest optimization.
Sharing Folders Between Host and Guest Systems
If you’re using QEMU with SPICE protocol for better integration with linux guest:
|
|
This provides:
- Clipboard sharing
- Better display resizing
- Mouse pointer integration
Working With Physical Disks in Virtual Machines
For advanced users who need to work with physical disks in their VMs:
-
First identify your disks:
1sudo fdisk -l -
Create physical volume (LVM):
1sudo pvcreate /dev/sdXX(Replace XX with your actual disk identifier)
For a complete tutorial on this process, see: Working with Physical Disks in VMs
- Physical disk passthrough requires proper permissions and can be risky - always back up data first.
Bridge network for QEMU/VirtManager
To create a Bridge network to share with the VM I do this on host:
|
|
(Replace eno1 with your actual physical interface name - find it with ip link)
Add allow br0 on /etc/qemu/bridge.conf
Windows guest
When I install Windows VM on my Linux Host, I do this:
Prerequisites
Before install Windows, you need to download VirtIO drivers, for use VirtIO disks and network.
- Go to VirtIO drivers page and download the ISO.
- Create a new VM on VirtManager and mount the ISO as CD-ROM with SATA protocol.
- Create a new disk for the VM as VirtIO disk.
- Mount Win ISO to install.
- For network use Bridge
br0as source andvirtioas device model. - On
Display Spiceselect Type=Spice Server and Listen type=None.
Installation
- Run the VM with Win ISO as first boot.
- Next, next, next.
- When u have to select the disk to install, nothing will appear, select
Load Driversand select the drivers ondisk/viostor/w1x/amd64and Next.- W1x will be W10 or W11.
- Also can load the driver for the network on
disk/NetKVM/W1x/amd64and Next.
Install Windows as usual.
After Windows install, go to the CD Drive and install
virtio-win-gt-x64 and virtio-win-guest-tools drivers.
Share folder
On Host
Create the Shared Folder
- On your Linux host, create a folder you wish to share (e.g., ~/share).
Open Virt-Manager and Edit the VM
- Select your Windows VM and click “Open”.
- Click the “Show virtual hardware details” button.
- Select the “Memory” section.
- Check the “Enable shared memory” option and apply the changes
Add the Shared Folder:
- Click “Add Hardware”.
- Select “Filesystem”.
- Set the driver to
virtiofs. - Set the “Source path” to the folder you want to share (e.g.,
/home/youruser/share). - Set the “Target path” to a descriptive name (e.g.,
HostShare). This will appear as the share name in Windows
On Guest
Install WINFSP driver.
Restart.
Open Services app.
Find WINFSP and start it. Also set it to “Automatic”.
The folder will appear as HostShare on “This PC”.
Extra: VMware (Windows host)
If you’re using VMware and need to set up shared folders between your host and Linux guest systems:
-
First install VMware tools:
1sudo apt install open-vm-tools -
Create a directory for your shared folders:
1mkdir /home/$USER/shares -
Mount the shared folder using:
1vmhgfs-fuse .host:/ /home/$USER/shares -o subtype=vmhgfs-fuse,allow_other
The allow_other option allows all users to access the shared folder.