virtualboxdebianguestadditions

Virtual Box Debian Guest Additions

Nach dem installieren eines Debian in VirtualBox fehlen ja die Gasterweiterungen, da mich die manuelle Installation jedes mal super nervt hier ein Skript für Debian 12.9.0. https://greenwebpage.com/community/how-to-install-virtualbox-guest-additions-on-debian-12/

#!/bin/bash
# build with copilot.microsoft.com

# Comment out CD/DVD sources in /etc/apt/sources.list
sudo sed -i.bak '/^deb cdrom:/s/^/#/' /etc/apt/sources.list

# Update package lists
sudo apt-get update

# Install necessary packages for kernel module building
sudo apt-get install -y build-essential gcc dkms linux-headers-$(uname -r)

# Pause to insert ISO
echo "Please insert the Guest Addition ISO and press any key to continue..."
read -n 1 -s -r -p ""

# Create mount point
sudo mkdir -p /mnt/cdrom

# Mount the ISO
sudo mount /dev/cdrom /mnt/cdrom

# Check if the ISO is mounted
if mountpoint -q /mnt/cdrom; then
  # Go to folder
  cd /mnt/cdrom
  
  # Install now
  sudo sh ./VBoxLinuxAdditions.run --nox11
  
  # Unmount the ISO
  sudo umount /mnt/cdrom
  
  # Reboot to apply changes
  sudo reboot
else
  echo "Error: The Guest Addition ISO is not mounted. Please check if the ISO is properly inserted."
fi
  • virtualboxdebianguestadditions.txt
  • Zuletzt geändert: 2025/02/11 14:23
  • von Fabian Horst