Looking glass/GPU passthrough/baby's first VM

I’ve got the latest ubuntu installed, I’ve managed to get the looking glass dependencies installed, and LG downloaded and built, but I need a Libvirt VM and I’m having trouble figuring out how to even install libvirt

it wants me to CD to its source location and “make” but I’m not sure which dir is it’s source? I downloaded the tar file and extracted it but idk which one of these folders is the source?

1 Like

Okay, let’s take a step back. Looking Glass is the final step. It’s good that you have all the deps installed, but you need to get the VMs working first.

so to install libvirt on Ubuntu, you’ll need the following packages installed:

libvirt-daemon qemu virt-manager # virt-manager needed for GUI configuration

yeah I know I was just following the quickstart guide

1 Like

is there a command line way of installing it, in a stroke of irony the GUI way of installing is a headache for me to figure out

Once you have libvirt installed, you’ll need 2 ISOs.

  1. Windows 10 (has to be 10, 7 isn’t supported by LG)
  2. virtio drivers, can be found here: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/

Yes, but it’s helpful to have virt-manager installed as well. (for troubleshooting)

so just sudo apt install those packages.

sudo apt get libvirt
says thats an invalid opteration

ahhhh nuts I did get not install

unable to locate package libvirt

Shoot, sorry, it’s libvirt-daemon

Damn 'buntu

summoning the daemon

1 Like

wait I’m going to need a win10 iso aren’t I
that was easier than I thought
https://www.microsoft.com/en-gb/software-download/windows10ISO

I think you made it past it, but it would be:

sudo apt-get update
sudo apt-get install

you forgot the “install” command

I did sudu apt get the first time, didn’t work
what worked for me was sudo apt install

okay I got the Win10 iso installed and the packages installed what next?

Okay, now you need to make a windows VM.

So, the easiest way I’ve found is to make the VM in virt-manager, then edit it with virsh (the cli tool) later.

yeah I just saw the VM manager appear in the app list as soon as you typed that, installing windows now

1 Like

So there are come flags that need to be configured.

You need to use Q35 and UEFI.

You also need to use virtio for your storage devices (sata for virtual CD drives)

You need one HDD and two CD drives. One for windows, one for the virtio drivers iso.

Then, you should set your VM to have 8GB of ram to start. We can play with the exact number later.


I have to step out for a bit, but between my older guide and Wendell’s Ubuntu guide, you should be able to get most of the way there, if not 100%.

Looking Glass is really the most difficult part.

1 Like

okay reinstalling windows VM with those settings, in bios I have IOMMU set to enabled not auto, there was something that said I need to edit the bootloader or something to enable IOMMU but I’m not really sure how to go about that

Right, so you need to edit /etc/default/grub to have either:

iommu=1 amd_iommu=on

or

iommu=1 intel_iommu=on

Depending on if you have an intel or amd system.

Then you need to do a sudo grub-mkconfig -o /boot/grub/grub.cfg to apply the changes.

Then you can save this script as iommu and run it:

#!/bin/bash
shopt -s nullglob
for d in /sys/kernel/iommu_groups/*/devices/*; do 
    n=${d#*/iommu_groups/*}; n=${n%%/*}
    printf 'IOMMU Group %s ' "$n"
    lspci -nns "${d##*/}"
done;

and it’ll print out your IOMMU groups, so we know if we need to use the ACS patch. Now, the ACS patch is a bit of a rabbit hole for DIY, but luckily, I have debs that I build myself for my local machine (and sharing) if needed.

giga@giga-AB350N-Gaming-WIFI:~$ sudo grub-mkconfig -o /boot/grub/grub.cfg
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-31-generic
Found initrd image: /boot/initrd.img-5.4.0-31-generic
Found linux image: /boot/vmlinuz-5.4.0-26-generic
Found initrd image: /boot/initrd.img-5.4.0-26-generic
Adding boot menu entry for UEFI Firmware Settings
done
giga@giga-AB350N-Gaming-WIFI:~$ #!/bin/bash
giga@giga-AB350N-Gaming-WIFI:~$ shopt -s nullglob
giga@giga-AB350N-Gaming-WIFI:~$ for d in /sys/kernel/iommu_groups/*/devices/*; do 
     n=${d#*/iommu_groups/*}; n=${n%%/*}
     printf 'IOMMU Group %s ' "$n"
     lspci -nns "${d##*/}"
 done;
IOMMU Group 0 00:01.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]
IOMMU Group 10 0a:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio Controller [1002:15de]
IOMMU Group 10 0a:00.2 Encryption controller [1080]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor [1022:15df]
IOMMU Group 10 0a:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Raven USB 3.1 [1022:15e0]
IOMMU Group 10 0a:00.4 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Raven USB 3.1 [1022:15e1]
IOMMU Group 10 0a:00.6 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller [1022:15e3]
IOMMU Group 1 00:01.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0] [1022:15d3]
IOMMU Group 2 00:01.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0] [1022:15d3]
IOMMU Group 3 00:08.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]
IOMMU Group 4 00:08.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus A [1022:15db]
IOMMU Group 5 00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 61)
IOMMU Group 5 00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge [1022:790e] (rev 51)
IOMMU Group 6 00:18.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 0 [1022:15e8]
IOMMU Group 6 00:18.1 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 1 [1022:15e9]
IOMMU Group 6 00:18.2 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 2 [1022:15ea]
IOMMU Group 6 00:18.3 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 3 [1022:15eb]
IOMMU Group 6 00:18.4 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 4 [1022:15ec]
IOMMU Group 6 00:18.5 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 5 [1022:15ed]
IOMMU Group 6 00:18.6 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 6 [1022:15ee]
IOMMU Group 6 00:18.7 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 7 [1022:15ef]
IOMMU Group 7 01:00.0 3D controller [0302]: NVIDIA Corporation GK110BGL [Tesla K40m] [10de:1023] (rev a1)
IOMMU Group 8 02:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset USB 3.1 xHCI Controller [1022:43bb] (rev 02)
IOMMU Group 8 02:00.1 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset SATA Controller [1022:43b7] (rev 02)
IOMMU Group 8 02:00.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Device [1022:43b2] (rev 02)
IOMMU Group 8 03:00.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)
IOMMU Group 8 03:01.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)
IOMMU Group 8 03:04.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)
IOMMU Group 8 03:05.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)
IOMMU Group 8 03:06.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)
IOMMU Group 8 03:07.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)
IOMMU Group 8 07:00.0 Network controller [0280]: Intel Corporation Wireless 3165 [8086:3165] (rev 81)
IOMMU Group 8 09:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)
IOMMU Group 9 0a:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] [1002:15dd] (rev c6)

wrap it with backticks for code blocks. “`”

I’m not actually sure how to get to that grub file, did the command you gave me already edit it or did it just disable read only mode?
sudo grub-mkconfig -o /boot/grub/grub.cfg