Virtual Box Notes
Virtual Box
Section titled “Virtual Box”To install VirtualBox Guest Additions on a GUI-less Ubuntu Server
Section titled “To install VirtualBox Guest Additions on a GUI-less Ubuntu Server”- Install prerequisites Open a terminal in your Ubuntu Server guest and run these commands to install the required packages:
sudo apt updatesudo apt install dkms build-essential linux-headers-$(uname -r)- Insert and mount the Guest Additions CD image From the VirtualBox menu on your host machine, go to Devices and select Insert Guest Additions CD image… The CD image should appear in your server’s file system, often under /media/cdrom or a similar path. Mount the CD image if it’s not automatically mounted:
sudo mkdir /media/cdromsudo mount /dev/cdrom /media/cdrom- Run the installation script Navigate to the mounted directory: Run the installer script. You may need to switch to the root user first for a GUI-less server:
cd /media/cdromsudo ./VBoxLinuxAdditions.run- Restart the virtual machine Restart the guest machine for the changes to take effect:
sudo rebootTo setup the share folder from the Host to the vm
Section titled “To setup the share folder from the Host to the vm”modinfo vboxguestsudo usermod --append --groups vboxsf -- "$USER"cat /etc/group | grep "$USER"
sudo usermod -aG vboxsf $USER
# /etc/fstabshare /mnt/share vboxsf defaults 0 0VMWare Player
Section titled “VMWare Player”sudo mount -t vboxsf share /mnt/share
# vmware playersudo apt install open-vm-tools# /etc/fstabvmhgfs-fuse /mnt/hgfs fuse defaults,allow_other 0 0