Posts

Showing posts from May, 2024

Minimizing a linux virtual disk image with zerofree

How to make your linux drive image smaller with zerofree and virtualbox-manage First you need to write zeroes on top of old unallocated data (the files you have deleted) on the virtual drive. This is done with zerofree. zerofree will only overwrite unallocated data so the Virtualbox drive image file will not get any bigger than it already is. Then we use vboxmanage to compact the virtual disk image. Note that this will not work if you are using an encrypted hard disk. This is because the zeroes written by zerofree will be encrypted. In that case, the virtual disk image will grow to it's full size. 1. Install zerofree First, install zerofree on your virtual machine: sudo apt install zerofree 2. Log in to recovery mode Log in to your machine in recovery mode. At startup, press shift to see GRUB menu. Select Advanced options and recovery mode for the newest kernel. Then select Root from the menu. Press enter when it asks you to "Press enter for maintenance". 3. Remount the d

Fix the login loop in Xubuntu 24.04

 I had some problems logging into my brand new Xubuntu 24.04 LTS install running on Virtualbox. On the first login, I was booted back to the login screen. Opening some apps would also throw me out of the GUI session to the login screen. Eventually, I got into a loop where I get continually thrown into a login screen. This bug is mentioned on the Xubuntu homepage as a known issue: Xorg crashes and the user is logged out after logging in or switching users on some virtual machines  Seems that this bug also affects Ubuntu 24.04 . To get a terminal from the login screen, I pressed Ctrl-Alt-F1 and logged in. To get back to the GUI login, you can press Ctrl-Alt-F7. To fix the problem, I had to remove libva-wayland2: sudo apt remove libva-wayland2  After this, login is possible again in GUI mode (Ctrl-Alt-F7). However, this also uninstalled some apps I wanted. Looks like I have to skip Xubuntu 24.04 or Ubuntu 24.04 for now until this is fixed.