As with all projects this was to scratch an itch. Starting with Debian 10, VirtualBox was no longer included in the distribution. Don’t get me wrong, VirtualBox is an awesome product but I wanted to “stretch my legs” and try something a bit different. QEMU is the grandaddy of virtualization starting way back in 2007. In this case I’ll be using QEMU with KVM which adds hardware virtualization support for x86(32 & 64 bit) architectures.
The goal is to mimic all the functionality I had with Virtualbox but with QEMU. In my case Windows 10 is a necessary evil if you own any Garmin GPS devices and need to update them (ZERO Linux support).
This document will walk you through the configuration I have developed to make this work smoothly. Note, it is assumed you are extremely familiar with Linux and a bash (or some other) shell.
The following sites were used as reference to help piece this together:
This command will create a qcow2 (can’t make this up) disk image of 100Gb. Note this image file is NOT fully allocated at creation, be sure you have room for this file to expand to it’s capacity!
qemu-img create -f qcow2 win10.qcow2 100G
Trust me, you are going to want to do this very important step. There are WAY too many command line options to just type in on the fly. This is almost a direct rip off from the gentoo instructions linked above:
#!/bin/sh
exec qemu-system-x86_64 \
-enable-kvm -cpu host -m 4G \
-drive file=win10.qcow2,if=virtio \
-device virtio-tablet \
-rtc base=localtime \
-net nic,model=virtio-net-pci -net user,hostname=win10 \
-monitor stdio \
-name "win10" \
-usb -device usb-ehci -device usb-host,vendorid=0x091e \
-display gtk,grab-on-hover=on \
"$@"
Lets talk about what this does line by line:
./win10.sh -boot d -drive file=win10cd.iso,media=cdrom -drive file=virtio-win.iso,media=cdrom
This is where the fancy bash-fu comes into practice. The above command will do the following:
Your windows installation media iso should boot in the VM window.
You can “free” your mouse/keyboard by using Ctrl-Alt-g.
QEMU has a few paravirtualized drivers to make your virtual machine perform better.
Ethernet Controller Driver
- Right Click on “Other Devices/Ethernet Controller” select Update Driver
- Click “Browse my computer for driver software”
- Search for drivers (and subfolders) in E:\, click next.
- Install the VirtIO Ethernet Adapter
HID Driver (Human Interface Device)
- Right Click on “Other Devices/PCI Input Device” select Update Driver
- Click “Browse my computer for driver software”
- Search for drivers (and subfolders) in E:\, click next.
- Install the VirtIO Input Driver
Display Driver
- Right Click on “Display adapters/Microsoft Basic Display Adapter” select Update Driver
- Click “Browse my computer for driver software”
- Select “Let me pick from a list of available drivers on my computer”
- Click “Have Disk…”
- Copy files from: E:\qxldod\w10\amd64
- Select the “QXL controller” driver, click next.
- Verify that you Really want to install the driver.
Install the Guest Agent
- Navigate to E:\guest-agent in Explorer and run qemu-ga-x86_64
- Follow the default prompts.
Run the lsusb command once your device is plugged in. You should see a line similar to the following:
Bus 001 Device 020: ID 091e:2a1a Garmin International
In our case we want to pass through ALL Garmin devices so we’ll focus on VendorID, in this case it’s “091e”
Create the following file: /etc/udev/rules.d/10-qemu-hw-users.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="091e", TAG+="uaccess"
Following this run the following to update the udev system.
udevadm control --reload-rules
This should give you the necessary permissions to manage these devices without root access.
In your VM you should see a new “USB Mass Storage Device” called “Garmin Drive”
Created: 2020-07-02 | Modified: 2024-05-09 |