User Tools

Site Tools


vm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
vm [2024/03/22 14:07] – created A User Not Logged invm [2025/05/17 12:47] (current) ealmr
Line 1: Line 1:
 +====== QEMU ======
 +
 +resize qcow2 size:
 +
 +  qemu-img resize /path/to/qcow2 20G
 +  qemu-img resize /path/to/qcow2 +20G
 +
 +grow guest partition size:
 +
 +  growpart /dev/vda X
 +  # grow ext4
 +  resize2fs /dev/vdaX
 +  # grow btrfs
 +  btrfs filesystem resize max /
 +
 +====== Hyper-V ======
 +
 +convert qcow2 image to vhdx:
 +
 +  qemu-img convert -p -f qcow2 -O vhdx /path/to/qcow2 /path/to/vhdx
 +
 +====== WSL ======
 +
 +general commands:
  
   wsl --mount --vhd <VHD> --bare   wsl --mount --vhd <VHD> --bare
Line 4: Line 28:
   growpart /dev/sda 1   growpart /dev/sda 1
   Resize-VHD –Path <VHD> –SizeBytes 30GB   Resize-VHD –Path <VHD> –SizeBytes 30GB
 +  
 +shrink VHD:
 +
 +  optimize-vhd -Path .\ext4.vhdx -Mode full
 +
 +to fix DISPLAY on Arch, create following systemd service:
 +
 +<code>
 +https://superuser.com/questions/1617298/wsl-2-running-ubuntu-x-server-cant-open-display/1834709#1834709
 +cat > /etc/systemd/system/wslg.service <<EOF
 +[Unit]
 +Description=symlink /tmp/.X11-unix
 +After=systemd-tmpfiles-setup.service
 +
 +[Service]
 +Type=oneshot
 +ExecStart=rmdir /tmp/.X11-unix
 +ExecStart=ln -s /mnt/wslg/.X11-unix /tmp/
 +
 +[Install]
 +WantedBy=sysinit.target
 +EOF
 +</code>
 +
 +enable this service:
 +
 +  systemctl enable wslg
 +====== Configs ======
 +
 +systemd-networkd:
 +
 +<code>
 +[Match]
 +Name=eth*
 +
 +[Network]
 +DHCP=yes
 +</code>
vm.1711116471.txt.gz · Last modified: by A User Not Logged in

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki