Update: as of 2019-01 and CentOS 7.6

the below setup may fail by now, for those reasonsBUT you CAN compile the latest kernel and all modules yourself (DON’T BE SHOCKED! YOU CAN DO IT! IT’S NOT ROCKET SIENCE!… just follow my howto -> https://dwaves.de/2017/06/30/centos-redhat-compiling-the-latest-kernel/)

works like a charm 🙂

hostnamectl
    Virtualization: kvm
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 4.20.2
      Architecture: x86-64

it is pretty cool… a 32Bit Linux Host can run a 64Bit Linux guest. NICE 😉

i assume you have a working CentOS7 basic installation and are root.

tested on/with:

tested with: Host: CentOS7 and Debian 8 Jessie

Operating System: Debian GNU/Linux 8 (jessie) + VirtualBox 5.2.2
Kernel: Linux 3.16.0-4-686-pae
Architecture: x86

Operating System: CentOS Linux 7 (Core) + VirtualBox 5.2.6
Kernel: Linux 3.10.0-693.17.1.el7.x86_64
Architecture: x86-64

Guest: CentOS7

hostnamectl
   Static hostname: localhost.localdomain
    Virtualization: kvm
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-693.11.1.el7.x86_64
      Architecture: x86-64

now let’s go:

yum update && yum upgrade; # first you will have to get CentOS7 up to date
# you really should reboot after this
# because the update possibly installs a new kernel
sync; shutdown -r now;
yum install epel-release; # add additional package resources
yum install vim net-tools htop; # optional: install basic tools

# OPTIONAL: if you want a gui
yum groupinstall "X Window system"; # this installs the basic grafical system <-
yum groupinstall "MATE Desktop"; # this installs mate
systemctl isolate graphical.target; # this makes linux boot the grafical profile per default
unlink /etc/systemd/system/default.target
ln -s /usr/lib/systemd/system/graphical.target /etc/systemd/system/default.target

reboot; # you might reboot now or not

now i hope you have mate up and running and want to install those cool integration tools: let’s install the virtualbox additions:

you will have to insert the virtual cd into the virtual cdrom drive like this:

this should do the job:

mkdir /virtualbox; # i copy the files from cdrom to harddisk /virtualbox... just got used to this workflow.

cat /proc/sys/dev/cdrom/info; # what is your cdrom/dvdrom named?
CD-ROM information, Id: cdrom.c 3.20 2003/12/17
drive name: sr0

# if not mounted automatically mount it manually
mkdir -p /run/media/cdrom; # make mount point
mount /dev/sr0 /run/media/cdrom/; # mount cdrom.iso
cd /run/media/user/VBox_GAs_5.2.2/; # in the debian8 case cdrom.iso was mounted here
cd /run/media/cdrom/; # in the CentOS7 case, it is not mounted automatically

cp -rv * /virtualbox/
cd /virtualbox/

yum install kernel-devel; # what you will need to compile the guest additions module
yum install gcc make perl bzip2
./VBoxLinuxAdditions.run

tail 10 /var/log/vboxadd-setup.log; # view the last 10 lines of log file

# check if vbox module driver was loaded
lsmod|grep vbox
vboxsf 42725 0 
vboxguest 301719 2 vboxsf
reboot; # reboot system to load kernel modules

proof that it is working

 

while you are on it

how to uninstall guest additions

there is a uninstall script located at….

(the * is the version number of the virtualbox software installed)

/opt/VBoxGuestAdditions-*/uninstall.sh

speedup boot

you can check the current “way” “parameters” “options” your system was booted with:

cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.10.0-862.3.2.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb

vim /etc/default/grub # modify 1 = wait 1 second until entry 0 is booted
GRUB_TIMEOUT=1
# if you want to see verbose output during boot remove the quiet at the end
grub2-mkconfig
grub2-mkconfig -o /boot/grub2/grub.cfg

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin