Skip to content

Blog

Installing Microsoft Edit in Debian or Ubuntu based distros

Microsoft Edit provides terminal editing with full mouse and copy-paste support.

???+ note The current version of Edit (1.2.0) is not available via the package manager apt yet. This could change at some point in the future, making for an easier deployment.

Install zstd, needed to decompress the downloaded archive:

Terminal window
sudo apt install zstd

Install the latest Edit version from GitHub for x86_64

Section titled “Install the latest Edit version from GitHub for x86_64”

Download and install the latest release: EDIT_VERSION=$(curl -s “https://api.github.com/repos/microsoft/edit/releases/latest” | grep -Po ‘“tag_name”: “v\K[0-9.]+’) wget -qO edit.tar.zst https://github.com/microsoft/edit/releases/latest/download/edit-$EDIT_VERSION-x86_64-linux-gnu.tar.zst sudo tar xf edit.tar.zst -C /usr/local/bin edit edit –version rm -rf edit.tar.zst

The commands above can be turned into a script for repeat installs.

Install glances and keep it running for showing gethomepage.dev system stats

Install glances and keep it running for showing gethomepage.dev system stats

Section titled “Install glances and keep it running for showing gethomepage.dev system stats”

This guide makes the glances application run in the background on every reboot and provide the necessary metrics for homepage.

Install pip:

Terminal window
sudo apt install python3-pip

Install glances with pip for this user:

Terminal window
pip install --user 'glances[web]'

Re-source the .profile so the glances executable is available in the current environment:

Terminal window
source ~/.profile

Update the crontab to run glances at startup without web UI but able to share system metrics (no web UI to make it more efficient):

Terminal window
# this goes in crontab
@reboot /home/ismael/.local/bin/glances -w --disable-webui

After a reboot, glances runs automatically on every boot. Works well in an LXC container.

Create the services.yaml entry for gethomepage.dev to show server root usage stats:

???+ note Several strings in this YAML need customization. See https://gethomepage.dev/widgets/services/glances/ for the specifics on the Glances widget.

...
- Docker:
- mini-docker:
icon: docker.png
widgets:
- type: glances
url: http://<IP of server>:61208
version: 4 # main version of glances used
metric: fs:/ # showing root usage
...

The result should look like this:

mini-docker glances widget

iGPU GVT-g Split Passthrough

iGPU GVT-g Split Passthrough (Intel Integrated Graphics)

Section titled “iGPU GVT-g Split Passthrough (Intel Integrated Graphics)”

Original guide: https://3os.org/infrastructure/proxmox/gpu-passthrough/igpu-split-passthrough/

Intel Integrated Graphics (iGPU) is a GPU that is integrated into the CPU. The GPU is a part of the CPU and is used to render graphics. Proxmox may be configured to use iGPU split passthrough to VM to allow the VM to use the iGPU for hardware acceleration for example using video encoding/decoding and Transcoding for series like [Plex][plex-url], [Emby][emby-url] and [Jellyfin][jellyfin-url]. This guide will show you how to configure Proxmox to use iGPU passthrough to VM.

!!! Warning “”

**Your mileage may vary depending on your hardware. The following guide was tested with Intel Gen8 CPU.**

!!! Failure “Supported CPUs”

`iGPU GVT-g Split Passthrough` is supported only on Intel's **5th generation to 10th generation** CPUs!
Known supported CPU families:
- **Broadwell**
- **Skylake**
- **Kaby Lake**
- **Coffee Lake**
- **Comet Lake**

There are two ways to use iGPU passthrough to VM. The first way is to use the Full iGPU Passthrough to VM. The second way is to use the iGPU GVT-g technology which allows as to split the iGPU into two parts. We will be covering the Split iGPU Passthrough. If you want to use the split Full iGPU Passthrough you can find the guide [here][igpu-full-passthrough-url].

Proxmox Configuration for GVT-g Split Passthrough

Section titled “Proxmox Configuration for GVT-g Split Passthrough”

The following examples uses SSH connection to the Proxmox server. The editor is nano but feel free to use any other editor. We will be editing the grub configuration file.

Edit the grub configuration file.

Terminal window
nano /etc/default/grub

Find the line that starts with GRUB_CMDLINE_LINUX_DEFAULT by default they should look like this:

Terminal window
GRUB_CMDLINE_LINUX_DEFAULT="quiet"

We want to allow passthrough and Blacklists known graphics drivers to prevent proxmox from utilizing the iGPU.

Your GRUB_CMDLINE_LINUX_DEFAULT should look like this:

Terminal window
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on i915.enable_gvt=1 iommu=pt pcie_acs_override=downstream,multifunction video=efifb:off video=vesa:off vfio_iommu_type1.allow_unsafe_interrupts=1 kvm.ignore_msrs=1 modprobe.blacklist=radeon,nouveau,nvidia,nvidiafb,nvidia-gpu"

!!! Note

This will blacklist most of the graphics drivers from proxmox. If you have a specific driver you need to use for Proxmox Host you need to remove it from `modprobe.blacklist`

Save and exit the editor.

Update the grub configuration to apply the changes the next time the system boots.

Terminal window
update-grub

Next we need to add vfio modules to allow PCI passthrough.

Edit the /etc/modules file.

Terminal window
nano /etc/modules

Add the following line to the end of the file:

Terminal window
# Modules required for PCI passthrough
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
# Modules required for Intel GVT-g Split
kvmgt

Save and exit the editor.

Update configuration changes made in your /etc filesystem

Terminal window
update-initramfs -u -k all

Reboot Proxmox to apply the changes

Verify that IOMMU is enabled

Terminal window
dmesg | grep -e DMAR -e IOMMU

There should be a line that looks like DMAR: IOMMU enabled. If there is no output, something is wrong.

Terminal window
[0.000000] Warning: PCIe ACS overrides enabled; This may allow non-IOMMU protected peer-to-peer DMA
[0.067203] DMAR: IOMMU enabled
[2.573920] pci 0000:00:00.2: AMD-Vi: IOMMU performance counters supported
[2.580393] pci 0000:00:00.2: AMD-Vi: Found IOMMU cap 0x40
[2.581776] perf/amd_iommu: Detected AMD IOMMU #0 (2 banks, 4 counters/bank).

Windows Virtual Machine iGPU Passthrough Configuration

Section titled “Windows Virtual Machine iGPU Passthrough Configuration”

For better results its recommend to use this [Windows 10/11 Virtual Machine configuration for proxmox][windows-vm-configuration-url].

Find the PCI address of the iGPU.

Terminal window
lspci -nnv | grep VGA

This should result in output similar to this:

Terminal window
00:02.0 VGA compatible controller [0300]: Intel Corporation CometLake-S GT2 [UHD Graphics 630] [8086:3e92] (prog-if 00 [VGA controller])

If you have multiple VGA, look for the one that has the Intel in the name.

Here, the PCI address of the iGPU is 00:02.0.

For best performance the VM should be configured the Machine type to ==q35==.
This will allow the VM to utilize PCI-Express passthrough.

Open the web gui and navigate to the Hardware tab of the VM you want to add a vGPU.
Click Add above the device list and then choose PCI Device

Open the Device dropdown and select the iGPU, which you can find using it’s PCI address. This list uses a different format for the PCI addresses id, 00:02.0 is listed as 0000:00:02.0.

Click Mdev Type, You should be presented with a list of the available split passthrough devices choose the better performing one for the vm.

Select ROM-Bar, PCI-Express and then click Add.

The Windows Virtual Machine Proxmox Setting should look like this:

Power on the Windows Virtual Machine.

Open the VM’s Console. Install the latest version of [Intel’s Graphics Driver][intel-gpu-drivers-url]{target=_blank} or use the [Intel Driver & Support Assistant][intel-driver-and-support-assistant-url]{target=_blank} installer.

If all when well you should see the following output in Device Manager and [GPU-Z][gpu-z-url]{target=_blank}:

That’s it! You should now be able to use the iGPU for hardware acceleration inside the VM and still have proxmox’s output on the screen.

Linux Virtual Machine iGPU Passthrough Configuration

Section titled “Linux Virtual Machine iGPU Passthrough Configuration”

We will be using Ubuntu Server 20.04 LTS for this guide.

From Proxmox Terminal find the PCI address of the iGPU.

Terminal window
lspci -nnv | grep VGA

This should result in output similar to this:

Terminal window
00:02.0 VGA compatible controller [0300]: Intel Corporation CometLake-S GT2 [UHD Graphics 630] [8086:3e92] (prog-if 00 [VGA controller])

If you have multiple VGA, look for the one that has the Intel in the name.

![Proxmox lspci vga][proxmox-lspci-vga-img]

Here, the PCI address of the iGPU is 00:02.0.

VM should be configured the Machine type to ==i440fx==.
Open the web gui and navigate to the Hardware tab of the VM you want to add a vGPU to.
Click Add above the device list and then choose PCI Device

![Ubuntu VM Add PCI Device][ubuntu-vm-add-pci-device-img]

Open the Device dropdown and select the iGPU, which you can find using it’s PCI address. This list uses a different format for the PCI addresses id, 00:02.0 is listed as 0000:00:02.0.

![Add iGPU MDev to VM][general-add-igpu-mdev-to-vm-img]

Click Mdev Type, You should be presented with a list of the available split passthrough devices choose the better performing one for the vm.

Select ROM-Bar, and then click Add.

The Ubuntu Virtual Machine Proxmox Setting should look like this:

Boot the VM. To test the iGPU passthrough was successful, you can use the following command:

Terminal window
sudo lspci -nnv | grep VGA

The output should incliude the Intel iGPU:

Terminal window
00:10.0 VGA compatible controller [0300]: Intel Corporation UHD Graphics 630 (Desktop) [8086:3e92] (prog-if 00 [VGA controller])

Now we need to check if the GPU’s Driver initalization is working.

Terminal window
cd /dev/dri && ls -la

The output should incliude the renderD128

That’s it! You should now be able to use the iGPU for hardware acceleration inside the VM and still have proxmox’s output on the screen.

Dbug Messages - Shows Hardware initialization and errors

Terminal window
dmesg -w

Display PCI devices information

Terminal window
lspci

Display Driver in use for PCI devices

Terminal window
lspci -k

Display IOMMU Groups the PCI devices are assigned to

#!/bin/bash
shopt -s nullglob
for g in $(find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V); do
echo "IOMMU Group ${g##*/}:"
for d in $g/devices/*; do
echo -e "\t$(lspci -nns ${d##*/})"
done;
done;

Auto-update the Windows hosts file with a hosted list

There are many reasons to do this, or to use an application like the one shared here. For example, an application that phones home may need testing for its behavior when it loses connection with an URL, or a system needs to be kept from accessing unsecure sites/services online.

hostctl’s GitHub page: https://github.com/guumaster/hostctl

Here is a simple example to use this app to update the hosts file with a hosted list on a specific URL.

!!! info inline end “Remember” This application works in multiple OSs. I’m just showing how to use it on Windows as an example.

Domains list Example URL: https://listwebsite.local/list.txt

  1. Put the executable in a directory covered by your PATH variable.
  2. Execute something like the following
hostctl add <myprofilename> -f https://listwebsite.local/list.txt
  1. The executable will create a profile called myprofilename inside the hosts file. That is to keep additions separate from the default/manually entered ones already in the hosts file.

This application can be used to perform backups and restores of the hosts file too. More about it can be found in the documentation at: https://guumaster.github.io/hostctl/

Fixing the GOG Galaxy 2.0 Ubisoft Connect plugin connection

Upon connecting the GOG Galaxy client to Ubisoft Connect, it goes into a disconnected state again. This happens just seconds after signing in to the Ubisoft Connect account using the plugin’s login.

???+ note This seems to be an open issue in the GitHub repo referenced below. A definitive solution has not been found as this method needs to be re-applied from time to time.

A solution shared on a Reddit post applies here:

Not able to connect my ubisoft connect with GoG galaxy
byu/ved7108 ingog

And this is also shared in this GitHub issue:

https://github.com/FriendsOfGalaxy/galaxy-integration-uplay/issues/33#issuecomment-1444362239

The basics are here for reference:

  • Click on the “Connect” button in the Ubisoft Connect integration settings on GOG Galaxy
  • Upon getting the screen, copy the (1) appId and (2) genomeId values from the pop-up URL

Ubisoft login screen /// caption Image showing the necessary values to copy from the login URL ///

  • Modify the file %localappdata%\GOG.com\Galaxy\plugins\installed\uplay_afb5a69c-b2ee-4d58-b916-f4cd75d4999a\consts.py
    • If using VSCode, you can just execute in a powershell shell this command
Terminal window
code %localappdata%\GOG.com\Galaxy\plugins\installed\uplay_afb5a69c-b2ee-4d58-b916-f4cd75d4999a\consts.py
  • Find the lines shown below and replace the values with the ones you got from the Ubisoft Connect login screen
CLUB_APPID = "f35adcb5-1911-440c-b1c9-48fdc1701c68"
CLUB_GENOME_ID = "5b36b900-65d8-47f3-93c8-86bdaa48ab50"
  • Save the file and log in on the Ubisoft Connect login screen
  • The client should now stay connected, as shown below

!!! info inline end “Remember” Remember that this fix, so far, needs to be re-applied if Ubisoft changes the values on their side

GOG Galaxy Integration Settings /// caption Image showing a working connection to Ubisoft Connect after a successful file modification ///