CentOS – How to Install Virtualbox Guest Additions via Command Line

centosvirtualbox

Reading the Virtualbox user manual, I finally got [here], which explains how to install Virtualbox Guest Additions on a Linux guest via Command Line.

But it's not clear enough for me (I just started learning some commands). Can someone put down the exact commands you would use to install Virtualbox Guest Additions via CLI? (which includes finding where virtualbox guest additions has been mounted etc.)

Best Answer

... finally this worked for me, should also work for anybody else trying to install VirtualBox Guest Additions on a CentOS (x86_64) virtual server in command line mode.

# yum update
# yum install dkms gcc make kernel-devel bzip2 binutils patch libgomp glibc-headers glibc-devel kernel-headers elfutils-libelf-devel
# mkdir -p /media/cdrom
# mount /dev/scd0 /media/cdrom
# sh /media/cdrom/VBoxLinuxAdditions.run

Note: In CentOS 7 and higher the cdrom is at /dev/sr0 instead of /dev/scd0.

When the process is complete, reboot the system. That's all.

Related Question