How to get VirtualBox guests to keep running on Ubuntu Desktop when you log out

You can’t just write boot into the grub command line.

There are very few instances where you can (env vars), but the fact that you get the commandline means those aren’t set.

The process is

linux (find linuz file) (command line args)
initrd (find initrd file)
boot

3 Likes

If else fails, wipe the MBR before reinstalling.

Although there’s a way to regenerate the grub configuration, but I haven’t done it in so long that I don’t remember how.

In my case, this is

linux (hd0,gpt1)/vmlinuz-linux root=/dev/nvme0n1p2
initrd (hd0,gpt1)/initramfs-linux.img
boot

Please note that this will not load cpu microcode, but it will get you to the installed system

I used lvm to set up partitions but none of the volumes have files in /boot… starting over and manually gonna scrub partitions first … try again…

1 Like

Ugh, dam. Grub setup has gotten a lot better in Linux over the years but is still a pain point. In my experience these are the things that make it more likely that grub will Just Work™

  • Before the install, set your BIOS boot mode to UEFI only and disable CSM (comparability support module). Depending on how secure you need the machine to be, I’d also recommend disabling Secure Boot.
    • Using hybrid boot mode (legacy + UEFI) changes how grub gets configured, since it will install both a legacy entry into the MBR table (or really a link to the entries) and a UEFI entry.
    • Grub’s UEFI menu and support typically works, but if you still have issues after installing in UEFI only mode, then you can replace grub’s EFI loader with rEFInd. Installing it is easy, and it will almost enitrely configure itself based on a scan of your EFI entries.

The general solution to most grub/boot issues is to just reconfigure grub. To do that, reboot into the live image, open a terminal and run the following commands: basically you are mounting just the portions of the installed OS needed for grub to configure itself, then regenerating the configuration.

ls /sys/firmware/efi
# make sure you see an efivars file -- that means you booted in EFI mode

# list disks and partitions
lsblk

# assuming you have the standard 3 partitions -- one for EFI, one for /boot and one for /root
mount /dev/sda3 /mnt  # root partition
mount /dev/sda2 /mnt/boot  # boot partition
mount /dev/sda1 /mnt/boot/efi  # EFI partition

mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys

# reinstall grub and update its configuration
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=debian

# at this point you can also install rEFInd if you want
apt install refind
# no configuration needed, just say yes when asked if you want it to install to the EFI partition
2 Likes

Starting fresh. Made changes to bios to ensure UEFI only… here’s what’s getting written to disk this go…

1 Like

Guys. I’m out. Going back to Ubuntu. The GUI is pointless here regardless of desktop and display manager. None of the network settings I am setting in xfce “advanced network settings” are actually doing anything when compared with ip command and reality on the ground when trying to ping etc.

In much the same way I went for a bambu x1 carbon 3D printer versus something else, I don’t have time for the nuances of Debian right now.

2 Likes

That is entirely fair! I’m glad you tried it though.

Next time you feel like switching try out TrueNAS Scale. Built in Docker support and no head needed.

2 Likes

Sounds like you’re missing the network manager package.

You’ll learn those as you go. Only here, you are not locked into a closed ecosystem. :smiley:

When I first started using Linux, I was absolutely terrified of the terminal. Now I prefer command line interfaces over GUIs for most things.

2 Likes