Artstation Github Mastodon Youtube

Necdet Yavaş

Linux Notes

Which distribution?

I use LMDE 6 (Linux Mint Debian Edition)

GPU Passthrough Process

Get IOMMU groups and device IDs:

#!/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;

Replace DEVICE_ID1 and DEVICE_ID2 with your actual device id that you want to passthrough.

GPUs usually have two IDs associated with them. 1 for GPU itself and 1 for audio controller built-in.

Part 1
Open Grub configsudo nano /etc/default/grub
Find the lineGRUB_CMDLINE_LINUX=
Addintel_iommu=on iommu=pt vfio-pci.ids=DEVICE_ID1,DEVICE_ID2
Apply Grub config changessudo update-grub
Part 2
Open vfio.confsudo nano /etc/modprobe.d/vfio.conf
Add linesoptions vfio-pci ids=DEVICE_ID1,DEVICE_ID2
softdep nvidia pre: vfio-pci
This line will prevent nvidia to takeoversoftdep nvidia pre: vfio-pci
Update initramfssudo update-initramfs -k all -u

Reboot.

Now GPU shouldn't be available for the host machine.

Check the drivers in use: lspci -k

Kernel driver in use should be vfio-pci for the selected GPU.

Virt Manager Notes

ErrorSolution
Access permission error Open with sudo virt-manager
Default network inactive Right click QEMU/KVM, click details, switch to Virtual Networks tab, start necessary pools

Set CPU topology manually. Last time I didn't use that option while creating a Windows VM and allocation of 8 cores ended up showing 2 different CPUs with 1 cores each, 2 cores total. Performance was bad, Unreal wasn't opening.

Backup VMs' XMLs. They won't boot with different name/uuid. Title change is fine.


CPU Pinning

Specifying which cores VM is allowed to use. Good for giving VM only the P cores.


Enable XML editing at preferences of virt-manager.

Find the line: <vcpu placement='static'>16</vcpu>

Add: cpuset='desiredCores' after placement='static'


For example: <vcpu placement='static' cpuset='0-15'>16</vcpu>


cpuset='0-15' gives all cores starting from 0 to 15

cpuset='0,2,4,6,8' gives specified cores


Sharing Folder

Name you enter to target path will be the mounted folder name.

For example if you named it hostFolder

Linux
Auto MountManual
Edit fstab: sudo nano /etc/fstabCreate a folder on desktop. For example: mountFolder
Add line: hostFolder /home/USERNAME/Desktop/mountFolder virtiofs defaults 0 0sudo mount -t virtiofs hostFolder ./Desktop/mountFolder
Reload fstab: systemctl daemon-reload
For error checking try to mount everything in the fstab: sudo mount -a
It will be auto mounted on boot now.

Windows
Install virtio drivers
Install winfsp
Start service virtiofs service. Set startup type to automatic
Reboot
hostFolder should be auto mounted as a drive in explorer now.

Qemu Notes

Resize disk image

Only images in raw format can be resized in both directions, whereas qcow2 images can be grown but cannot be shrunk.


Browse to the location of the image file.

Launch terminal/console


sudo qemu-img resize -f fmt fileName [+|-]size[K|M|G|T|P|E]

-f specifies the disk image format. It is guessed automatically if you don't specify.

Replace "fileName" with the image name you want to resize.

Replace "size" with the amount you want to add or shrink.

"+" to increase size. After growing a disk image, you must use file system and partitioning tools inside the VM to actually begin using the new space on the device.

"-" to shrink size. Before shrinking a disk image, you must use file system and partitioning tools inside the VM itself to reduce allocated file systems and partition sizes accordingly. Failure to do so will result in data loss.

Use K for kilobytes(1024), M for megabytes(1024k), G for gigabytes(1024M), T for terabytes(1024G), P for Petabytes(1024T), E for exabytes(1024P).


For example: sudo qemu-img resize -f raw test.img +50G
Increases the size of test.img by 50 gigabytes.

Cinnamon Notes

Theme Editing

Open system settings, go to themes.

Click advanced settings.

Get the name of the current desktop/application theme.

They use the same theme by default.

Default theme files are located in /usr/share/themes

Duplicate your current theme folder and rename it.

This name will show up in desktop/application themes now.

Open the cinnamon and gtk-3 folder inside the folder you just renamed.

Edit cinnamon.css, gtk.css, gtk-dark.css

Select the new theme.

Restart Cinnamon to see your changes in effect. Press Alt+F2 and enter restart


Show hidden files Ctrl+H

You can move your new theme into /home/USERNAME/.themes but some apps won't apply themes in that folder.

Desktop Panel

Open cinnamon.css of your theme.

Find the line: .panel-top, .panel-bottom, .panel-left, .panel-right

background-color property affects the color and opacity of the desktop panel.

Restart Cinnamon to see your changes in effect.

Precise Mouse Settings

Speed slider under "Pointer size and speed" in "Mouse and Touchpad" settings changes the "libinput Accel Speed".

"libinput Accel Speed" is a global setting. It applies to every connected mouse.

You can find this setting under: xinput list-props id

Find your device id: xinput list

I just adjust the slider and check the value with xinput list-props until I get the value I want.

Ramdisk Creation

ramfs is older, use tmpfs. I didn't research thoroughly but tmpfs is very easy to use.

tmpfs doesn't fill allocated space right away. It is dynamic. It means if it's empty it won't use any space at all. The size you specify is the upper limit.


Create a folder for mounting.

For example: A folder called ramdisk on Desktop

Auto mount on boot

Edit fstab: sudo nano /etc/fstab

Add the line: tmpfs /home/USERNAME/Desktop/ramdisk tmpfs defaults,size=4096m 0 0

Reboot

Manual

To mount: sudo mount -t tmpfs -o size=4096m tmpfs Desktop/ramdisk

Check with df -h Desktop/ramdisk

To unmount: sudo umount Desktop/ramdisk

Search File

You can use file managers' search function too but terminal is much faster when searching through lots of files and directories.


Search by namefind /path -name "filename"
Search by extensionfind /path -name "*.extension"

You can use "-maxdepth desiredNumber" to limit subdirectories.
For example find /home/USERNAME/Desktop -maxdepth 1 -name "example.txt" searches for example.txt in desktop but it doesn't go through all the directories present in desktop.

Linux Essentials

GuakeDrop down terminal
FlatsealFlatpak permission managerFlathub
WarehouseFlatpak managerFlathub
ParabolicMedia downloaderFlathub
PuddletagAudio tag editor
MediaInfoMetadata reader
Mission CenterSystem monitor / Task managerFlathub
KritaPainting / Image manipulationFlathub
GimpImage manipulationFlathub
InkscapeVector graphics
Blender3D creation
OBSRecording / StreamingFlathub
NewsflashRSS readerFlathub
HardinfoSystem information
Virt-ManagerVirtual machine manager. GUI for QEMU / KVM
VentoyBootable USB
BleachbitCleanup
TenacityAudio editing (Audacity without telemetry)Flathub
HandbrakeVideo TranscoderFlathub
PeaZipFile archiverFlathub
BlanketEnvironment soundsFlathub
GradienceAdwaita customizerFlathub
GpartedPartition editor
GpickColor picker

Linux Gaming

Steam and Heroic Launcher (for GOG and Epic store and library) are the easiest options.

Check Proton DB for compatibility information

Check Linux VR Adventures (LVRA) Wiki for Virtual Reality (VR) information