Linux virtualization - Setup virtualbox in Slackware
A virtualization in Linux has several meanings. The Linux virtualization term, as used by Novell, is consolidate workloads running on multiple physical servers onto a single physical server. The other meaning of Linux virtualization is installing another operating system on top of the current Linux operating system, which is known as native virtualization. You probably have heard about virtual pc and vmware in Windows environment. Those are virtualization software, which allow other operating system to be installed in the current operating system. They act as an interface between host and guest operating system.
This tutorial is about the native virtualization, installing a guest operating system in our current Linux. We are going to use Sun's Virtualbox virtualization software instead of VMware. Virtualbox is the only open source virtualization software available at the moment.
These are all steps needed to properly install Virtualbox in Slackware:
- Install ACPI Component Architecture (acpica).
- Download virtualbox-ose slackbuild scripts.
- Compile VirtualBox Open Source Edition.
- Install VirtualBox Open Source Edition Slackware package.
- Checking and testing Virtualbox
You can check the How to install The ACPI Component Architecture (ACPICA) in Linux tutorial for a guide. When you finished the acpica installation, create a symbolic link for iasl in the /usr/share and /usr/bin directories.
root@hitam:~# cd /usr/share/ root@hitam:~# ln -s /usr/local/src/acpica-unix-20081204/compiler/iasl root@hitam:/usr/share# cd ../bin/ root@hitam:/usr/bin# ln -s /usr/local/src/acpica-unix-20081204/compiler/iasl
Prepare Slackware build environment
To prepare the Slackware build environment, we are going to create several directories to keep sources and build packages. This step is not mandatory but it's necessary to keep our system clean. These are directories suggested by Slackbuilds dot com:
- /home/slackware - A dedicated directory for Slackware build environment.
- /home/slackware/source - To keep all Slackware sources to be build.
- /home/slackware/source/myslackware/
- Build package here. - /home/slackware/packages - Keep all finished packages.
Create a group for build environment. Add user for this group to build and manage Slackware build environment. Here is an example:
root@hitam:~# groupadd packager root@hitam:~# usermod -G packager luzar root@hitam:~# groups luzar luzar : users packager
Change group owner for /home/slackware directory and sub-directories.
root@hitam:~# chown -R root.packager /home/slackware/
Download slackbuild scripts for VirtualBox Open Source Edition
Slackbuilds dot org team has developed many slackbuild scripts to build packages for Slackware. Download slackbuild script for virtualbox-ose from slackbuild dot org repository and move it to the /home/slackware/source/myslackware directory.
Install VirtualBox Open Source Edition
Download VirtualBox Open Source Edition source from Virtualbox website and move it to /home/slackware/source directory.
Download Virtualbox Additions iso and user manual from Virtualbox website and .
Add the script below in the /etc/rc.d/rc.local.
root@hitam:~# cat /etc/rc.d/rc.local
#!/bin/sh
#
# /etc/rc.d/rc.local: Local system initialization script.
#
# Put any local startup commands in here. Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.
# Start vboxdrv
if [-x /etc/rc.d/rc.vboxdrv]; then
/etc/rc.d/rc.vboxdrv start
fi
# Start vboxnet
if [-x /etc/rc.d/rc.vboxnet]; then
/etc/rc.d/rc.vboxnet start
fi
root@hitam:~#
Create /etc/rc.d/rc.local_shutdown and add the script below.
root@hitam:~# cat /etc/rc.d/rc.local_shutdown # Stop vboxdrv if [-x /etc/rc.d/rc.vboxdrv]; then /etc/rc.d/rc.vboxdrv stop fi # Stop vboxnet if [-x /etc/rc.d/rc.vboxnet]; then /etc/rc.d/rc.vboxnet stop fi root@hitam:~#
Make rc.local_shutdown executable.
root@hitam:~# chmod 755 /etc/rc.d/rc.local_shutdown
The Virtualbox need a group owner vboxusers. So create vboxusers group:
root@hitam:~# groupadd -g 103 vboxusers
Add user to the group:
root@hitam:~# usermod -G packager, vboxusers luzar root@hitam:~# groups luzar luzar : users packager vboxusers
Extract virtualbox-ose.tar.gz.
root@hitam:~# cd /home/slackware/source/myslackware/ root@hitam:/home/slackware/source/myslackware# ls virtualbox-ose.tar.gz root@hitam:/home/slackware/source/myslackware# tar zxvf virtualbox-ose.tar.gz root@hitam:/home/slackware/source/myslackware# ls virtualbox-ose/ virtualbox-ose.tar.gz
Copy the /home/slackware/source/VirtualBox-2.0.6-OSE.tar.bz2 source, Virtualbox Additions iso and user manual file to the virtualbox-ose directory, the extracted build directory.
root@hitam:~# cp /home/slackware/source/VirtualBox-2.0.6-OSE.tar.bz2
/home/slackware/source/myslackware/virtualbox-ose/ root@hitam:~# cd /home/luzar/Desktop/ root@hitam:/home/luzar/Desktop# mv VBoxGuestAdditions_2.0.6.iso
/home/slackware/source/myslackware/virtualbox-ose root@hitam:/home/luzar/Desktop# mv UserManual.pdf
/home/slackware/source/myslackware/virtualbox-ose
Run the slackbuild script.
root@hitam:~# cd /home/slackware/source/myslackware/virtualbox-ose/ root@hitam:/home/slackware/source/myslackware/virtualbox-ose# ./virtualbox-ose.SlackBuild
If the package compiled successfully, the result can be found in /tmp directory.
Copy the result package in /tmp directory to the /home/slackware/packages.
root@hitam:~# cp /tmp/virtualbox-ose-2.0.6-i486-2_SBo.tgz /home/slackware/packages/
Install VirtualBox Open Source Edition Slackware package
We can install our new Slackware Virtualbox package using installpkg or pkgtool.
root@hitam:/tmp# installpkg virtualbox-ose-2.0.6-i486-2_SBo.tgz
Checking and testing Virtualbox
We can check Virtual package has been successfully installed with pkgtool View option.
Finally, we can open Virtualbox with kde.
Although the virtualbox is already there, we still can't install guest operating system. We have to prepare a kernel driver for the new operating system we are going to install. Let's say we want to install Ubuntu server 8.10 as a guest, we need to create a base kernel driver for Ubuntu first.
Download suplementary kernel driver for the VirtualBox virtualisation environment from Slackbuilds dot org:
What we have to do now is just repeat the virtualbox installation steps above. For your convenient, here's the list:
- Place the virtualbox-kernel source in /home/slackware/source.
- Move the slackbuild virtualbox-kernel in /home/slackware/source/myslackware.
- Untar slackbuild virtualbox-kernel in /home/slackware/source/myslackware.
- Copy the virtualbox-kernel source in /home/slackware/source into the untar slackbuild virtualbox-kernel in /home/slackware/source/myslackware.
- Make virtualbox-kernel.SlackBuild executable. Use chmod 755 virtualbox-kernel.SlackBuild.
- Run virtualbox-kernel.SlackBuild with kernel version of your choice. For example, Ubuntu 8.10 uses 2.6.26, so you can run: KERNEL=2.6.26 ./virtualbox-kernel.SlackBuild
- Default result would be in /tmp directory. So you can copy the Slackware virtualbox-kernel tarball package result and keep one copy in /home/slackware/packages directory.
- Install the virtualbox-kernel tarball package with installpkg or pkgtool.
That's it. Now you can create new Ubuntu server virtual machine from Slackware kde. Have fun!
Popular content


Delicious
Digg
StumbleUpon
Propeller
Reddit
Newsvine
Furl
Facebook
Google
Yahoo
Technorati
Icerocket
Post new comment