Wednesday, May 30, 2018

Installing Virtualbox guest additions in Debian guest

From https://unix.stackexchange.com/questions/286934/how-to-install-virtualbox-guest-additions-in-a-debian-virtual-machine


Follow these steps to install the VirtualBox Guest Additions on your Linux Debian virtual machine:
  1. Open terminal and become root (su); if you have sudo enabled, you may also do for example sudo -i; see man sudo for all options):
    su
    
  2. Update APT cache:
    apt-get update
    
  3. Install the latest security updates:
    This step will upgrade all your packages, so be wise about it. Try the following steps first and they might be enough to work if not, then perform upgrade and retry.
    apt-get upgrade
    
  4. Install these required packages:
    Packages build-essential and module-assistant are both required to be able to compile the kernel modules and so when installing the VirtualBox Linux Guest Additions you must have them. So, this command will get the headers and packages (compilers and libraries) required to work. Notice, that after installing your VirtualBox Linux Guest Additions you will leave behind some packages as well as Linux headers, which you might delete afterwards or not. In my case they didn't hurt, but for the sake of system tidiness, you might want to pick up after playing.
    apt-get install build-essential module-assistant
    
  5. Configure your system for building kernel modules:
    m-a prepare
    
  6. Insert Guest Additions ISO:
    Expand menu Devices and click on Insert Guest Additions CD image...
  7. It should mount automatically, but if for any reason it doesn't:
    mount /media/cdrom
    
  8. Run the following script:
    sh /media/cdrom/VBoxLinuxAdditions.run
    
  9. Restart the system:
    reboot
    

No comments: