home network:
- opnsense router
- lan subnet: 192.168.101.0/24
- wireguard subnet: 192.168.102/24
vps:
- 1 public ip
c2:d1:05:16:b0:b5
Reference: https://qubitrenegade.com/virtualization/kvm/vfio/2019/07/17/VFIO-Fedora-Notes.html
This method of VFIO supports identical GPU as described in the original reference.
This gist is only to fix some typo or error I encountered when applying the steps decribed in the original reference, while also adding my own customization.
Machine Spec:
CPU: AMD Ryzen 1700
RAM: 64GiB (20GiB will be dedicated to the Guest)
ID 46f4:0001 QEMU QEMU USB HARDDRIVE |
yum --enablerepo=extras install epel-release | |
yum -y install dsniff | |
tcpkill -i eth0 -9 port 6379 |
#!/bin/sh | |
# create ovs bridge named bridge0 | |
nmcli conn add type ovs-bridge conn.interface bridge0 autoconnect yes | |
# add add a port to the bridge for the internal ovs interface (iface0) | |
nmcli conn add type ovs-port conn.interface port0 master bridge0 autoconnect yes | |
# add internal ovs interface to the create port0 | |
nmcli conn add type ovs-interface conn.interface iface0 master port0 autoconnect yes ipv4.method auto |
#!/bin/sh | |
iptables -t nat -A POSTROUTING -o <eth0 or whatever else> -j MASQUERADE | |
# to persist the rule, install iptables-persistent package |
Fix monitor resolution on linux with nvidia GPU because the monitor EDID information is unavailable.
This fix assume we are using multiple monitor setup with the same monitor, so we can grab the EDID information of the monitor, from the other monitor attached to another output port (D-SUB
, DVI
, HDMI
, DisplayPort
)
In my setup, I have 3 Dell S2415H attached to D-SUB
, HDMI
, and DVI
port.
The monitor which was attached to the D-SUB
port (VGA-0
), doesn't has any EDID information available, thus I was unable to use the native 1920x1080 resolution.
Step to overcome the situation:
nvidia-settings
:nvidia-settings
appcommand: apt-get install qemu-kvm libvirt-bin bridge-utils virt-manager ovmf qemu-utils hugepages
command: for iommu_group in $(find /sys/kernel/iommu_groups/ -maxdepth 1 -mindepth 1 -type d); do echo "IOMMU group $(basename "$iommu_group")"; for device in $(ls -1 "$iommu_group"/devices/); do echo -n $'\t'; lspci -nns "$device"; done; done
outputs:
IOMMU group 17
0a:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] [10de:1c03] (rev a1)
0a:00.1 Audio device [0403]: NVIDIA Corporation GP106 High Definition Audio Controller [10de:10f1] (rev a1)
IOMMU group 16
09:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK208 [GeForce GT 710B] [10de:128b] (rev a1)
sudo apt-get update | |
sudo apt-get -y install --reinstall language-pack-en | |
sudo echo 'LC_ALL="en_GB.utf8"' >> /etc/environment | |
sudo apt-get -y install python-software-properties apt-file software-properties-common | |
#apt-file is useful to locate a file in apt, ex: apt-file search add-apt-repository | |
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install oracle-java8-installer |