Tag Archive : virtualization

/ virtualization

Testing ReactOS Using Preloaded QEMU Disk Image

December 9, 2015 | Article | No Comments

If previous article we discuss about installing ReactOS on QEMU from scratch, this time we will discuss about how to use preloaded ReactOS on QEMU. As proof of concept, I use:

  1. Slackware64 14.0 as host
  2. QEMU 1.4.0

I might using Linux for this article, but the preloaded archive itself is made specially for Windows.

Obtaining the Materials

As said, we will do installation of ReactOS on virtual machine using QEMU. Thus you have to make sure QEMU is installed and enable to run properly.

The main material we need is the ReactOS ISO itself. Go to http://reactos.org/, ReactOS’ official site. The latest version is 0.3.15 which is still in alpha version (not feature-complete and is recommended only for evaluation and testing purposes). ReactOS team provide three way to taste ReactOS, which are: Installation CD in iso format, Live CD, and preloaded image file. As our concern is installation ReactOS to QEMU, choose the Preloaded with QEMU. Upon finish downloading, extract the content which you will get a directory named ReactOS-0.3.15-QEMU. We will refer this iso as ROSdir

On the Directory

Go to ROSdir and let’s inspect what are inside. If you want to skip this section, go to next section for actual testing.

There are three items on the root: Readme.txt, boot.bat, and directory files. Basically this is specially prepared for Windows. The boot.bat is Windows batch script to invoke QEMU. All the materials are inside files directory. Go to files and here we see bunch of files. Basically these are all the materials.

There are some interesting files there:

  1. bios.bin: the PC BIOS which is used by QEMU to emulate x86_64 machine
  2. pxe-ne2k_pci.bin: Ethernet driver
  3. vgabios-cirrus.bin: driver for VGA
  4. SDL.dll: Dynamic Link Library (DLL) for SDL. This is used by QEMU.
  5. qemu.exe: the QEMU itself.
  6. qemu-img.exe: QEMU tools for manipulating disk image.

Boot and Testing

Back to ROSdir.

Now on our working directory, let’s invoke following command to spawn qemu.

qemu-system-i386 -m 256 -hda files/ReactOS.vmdk -net nic,model=ne2k_pci -net user \
-serial file:files/ReactOS.log

Notice the “.” on the command. Here we get some arguments.

  • -m 256 means we give 512MB of RAM. If you got plenty of RAM available and don’t mind share some, you can set this value higher.
  • -hda files/ReactOS.vmdk: ReactOS team provide us with vmdk file, which is VMware virtual disk format
  • -net nic,model=ne2k_pci: We will make use of networking using pxe-ne2k_pci driver
  • -serial file:files/ReactOS.log will log and catch debug message emitted by QEMU. Valid arguments to -serial include file names, pipes, COM ports, etc.

If the above command failed with following error: qemu-system-i386: Can’t open BIOS image bios.bin

Then you should find where bios.bin stored. Invoke following command to search it.

locate bios.bin

Let’s say it is on /usr/local/share/qemu/bios.bin, then invoke this to start up the qemu:

qemu-system-i386 -m 256 -cdrom ReactOS.iso -hda ReactOS.img -boot d -localtime \
-serial file:ReactOS.log -bios /usr/local/share/qemu/bios.bin

If you want to set the sound, go on and set emulation to AC97. To do that, add -soundhw ac97 as argument when calling qemu. You should also install drivers later. Alternatively, you can set the emulation to ES1370 using -soundhw es1370 instead of ac97 one.

Now, here is the screenshot:

qemu_react14

Installing ReactOS on VirtualBox

December 9, 2015 | Article | 2 Comments

In this article, we will discuss about ReactOS installation on VirtualBox. For this, I use:

  1. Slackware64 14.0 as host, although any Operating System is fine at least it can run VirtualBox
  2. VirtualBox 4.2.16.
  3. ReactOS iso file

Obtaining the Materials

As said, we will do installation of ReactOS on virtual machine using VirtualBox. Thus you have to make sure VirtualBox is installed and enable to run properly. For Slackware64, I have create a separated article about how to install VirtualBox on Slackware.

The main material we need is the ReactOS ISO itself. Go to http://reactos.org/, ReactOS’ official site. The latest version is 0.3.15 which is still in alpha version (not feature-complete and is recommended only for evaluation and testing purposes). ReactOS team provide three way to taste ReactOS, which are: Installation CD in iso format, Live CD, and preloaded image file. As our concern is installation ReactOS to VirtualBox, choose the Installation CD. There you should download approximately 64MB zip archived iso file. Upon finish downloading, extract the iso. We will refer this iso as ReactOS.iso

Create the Virtual Machine

Now come to the main business. ReactOS 0.3.15 is much more like Windows 98 and Windows XP. Therefore it should not burden your resource too much. Create a new machine for ReactOS with this (minimum) specification:

  • Machine Name: “ReactOS” (or anyname you want)
  • Machine Type: “Microsoft Windows”
  • Machine Version: “Windows XP”
  • Memory: 256 MB (but I use 1024 MB)
  • Hard disk: 10 GB

Other setting on my Virtual Machine:

  • Networking:
    • Type: NAT
    • Adaptor: “Intel Pro/1000 MT Desktop (8254EM)”
  • Audio: Intel AC’97
  • Storage Layout:
    • IDE Controller: CD Device, Hard Disk
  • Video Memory: 16 MB

Boot and Install

Run the virtual machine, you should then see something similar to this:

reactos1

Choose your preferred language. Just press ENTER until you are face with this screen:

reactos2

Here we are brought back to the era of Windows XP.

At this time, we have to partitioning our disk. Our disk is still raw, no partition. To create a partition, press C. Let’s pretend we want to use all of our disk space. Here we got only 1 partition, C:, unformatted. Press Enter to select it.

reactos3

Now, ReactOS support FAT as file system and no NTFS. The surprising part is, ReactOS supporting EXT2 filesystem. However on my first attempt (July 31, 2013) ReactOS won’t be installed if the partition is Ext2, stuck on copying acpi.sys file. so let’s choose FAT. Press Enter again when they ask for confirmation. And you will get following screen:

reactos4

If Windows is installed on \windows, ReactOS will have similar behavior. But instead of static pathname, ReactOS can be installed on any path. However at this time, let’s call it ReactOS.

reactos5

Then it will copying some files.

reactos6

Because we are installing on Virtual Machine, install the bootloader as well.

reactos7

Reboot! But don’t detach the ISO image from the virtual machine. You will be asked following operating system to boot (similar to GRUB or any other bootloader). Just choose ReactOS.

reactos8

When the machine boots, it will automatically run the ReactOS Setup Wizard. Acknowledge the license and click Next to continue with Setup.

Type your name and organization. Then give the computer a name. You are also asked an administrator password. The password, at this point, is optional. You can also change the system locale settings if you want or change the keyboard layout if you want. Next change the date and time if you need to, as well as the timezone.

reactos10

reactos11

reactos12

reactos13

reactos14

Once more reboot, and your ReactOS has been installed. Cheer! Here are the screenshots.

reactos15

reactos16

reactos17

reactos18

Managing VirtualBox VDI

December 9, 2015 | Article | 1 Comment

In earlier article we have discussed about how to install VirtualBox on Slackware64. We also have discussed about managing VirtualBox’ VM using command line.

VirtualBox has a graphical front end which gives us easy access to manage and utilize our virtual machines. Now suppose we are in a situation where we don’t have access to that shiny Graphical User Interface world (for example remote-accessing a server) and trying to manage VirtualBox’s Virtual Disk Image. Well, VirtualBox is not always about their GUI. In fact, we can too manage everything using terminal / command line.

In this article, we will discuss about some notes about how we can manage VDI. The term manage in this arcitle including: creating a VDI, resizing, mount images to our system, etc. In this article I use:

  1. Slackware64 14.0 as host
  2. VirtualBox 4.6.2

Although it is said that we use Slackware64 as host, the method we use here is a generic one. It means, we can do it into other linux distribution as well.

Create A Virtual Disk

Creating a Virtual Disk is as simple as creating one for Qemu. Here we need to specify where we will store the vdi and what size it should be.  The size would be on Mega Bytes unit. Now, we have two scenario:

Creating a Fixed Size (Static) VDI with 10GB size

Let’s do a simple calculation. The size should be 10GB, which is around 10*1024MB or 1024 MB. By default, VirtualBox will create a dynamic disk, unless told otherwise. In this scenario we will store the VDI as XathDisk.vdi on current working directory. The –variant Fixed is a must to make sure a static disk. Now the command to do so:

VBoxManage createhd --filename XathDisk.vdi --size 10240 --variant Fixed

Not so hard, isn’t it? 😀

Now, please note that a fixed size disc image can’t be resized (at least at this time, using VirtualBox 4.2.6).

Creating a Dynamic Size VDI with maximum size 10GB

It is even easier than previous scenario. Now, following command is creating the disk like previous did but in dynamic size

VBoxManage createhd --filename XathDisk.vdi --size 10240

Resizing the Virtual Disk

Resizing means we change the size of the disk. Fortunately, VirtualBox offer a tool to do so. On real machine, this would be like copying the disk data into different disk.

Please note that this method is currently works only for dynamic size disk.

Now, suppose we have a disk initially has a size of 8GB. We want to increase the disk size, or enlarging the size to 10GB. We can simply did following command:

VBoxManage modifyhd XathDisk.vdi --resize 10240

However, the size is logically used by disk to set it as maximum size while the partition in inside of disk still use the old size. You can use partition tool such as gparted to modify the partition size.

Clone VDI

Cloning a VDI mean we create an identical disk image to the older one. This is very useful especially if we experiment with machine having a high failure probability.

Now, to clone a Virtual Disk we can use following command:

VBoxManage clonehd <old one> <new one>

The <old one> is the source / the disk which we want to clone and <new one> is the result / the cloned disk.

Convert Dynamic to Static and Static to Dynamic Disk

 At this time, there is no default command to do conversion. What we can do is cloning old one to new one with different properties. Thus, we can convert dynamic to static disk by clone the disk and set the –variant to fixed and vice versa. Later, we can remove the old one and rename the new one as old one.

Here is how conversion work (assuming you use VDI format):

# Dynamic to Static
VBoxManage clonehd <old one> <new one> --variant Fixed
rm -f <old one>
mv <new one> <old one>

#Static to Dynamic
VBoxManage clonehd <old one> <new one> --variant Standard
rm -f <old one>
mv <new one> <old one>

Mounting a Virtual Disk

using Network Block Device

On every QEMU package, there is a tool for utilizing nbd (network block device). Technically speakin, QEMU use Kernel facility for communicating with network block device. The network block device itself is a “remote-server” and kernel use it as one of its block device. QEMU then will attach the VDI as if the VDI is a network block device. Later we can use the block device by mounting it to a directory.

Now let see the example. Using Xathrya.vdi, I will attach it to first network device. The network device is enabled after I insert kernel module nbd and then they are listed on /dev directory. I then mount it as /mnt/disk/nbd0 (which is already created).

modprobe nbd

# Attach & Mount
qemu-nbd -c /dev/nbd0 Xathrya.vdi
mount /dev/nbd0 /mtn/disk/nbd0

# Detach & Unmount
umount /dev/nbd0
qemu -d /dev/nbd0

Managing VirtualBox VM on Slackware64

December 7, 2015 | Article | 1 Comment

In earlier article we have discussed about how to install VirtualBox on Slackware64.

VirtualBox has a graphical front end which gives us easy access to manage and utilize our virtual machines. In some condition, we are restricted to use GUI while we want to manage virtual machine(s). This such condition might occur when we deal with service like cloud, or even managing our virtual machine on remote machine. Well, VirtualBox is not always about GUI. In fact, we can too manage everything using terminal / command line.

In this article, we will discuss about how we can manage VirtualBox’ Virtual Machine on Slackware. The term manage in this arcitle including: creating a VM, list supported OS, add device (disk, dvd, etc), and of course start/stop VM. In this article I use:

  1. Slackware64 14.0
  2. VirtualBox 4.6.2

Although it is said that we focus on Slackware64, but the method we use here is a generic one. It means, we can do it into other linux distribution as well.

For simplicity, I have divided this article into some stage.

Creating a Disk

VirtualBox can use VDI, VMware’s VMDK, etc. Originally, VirtualBox use VDI. There are two disk type: static size disk, or dynamic size disk. A static size means the file size is static and when created it will consume the specified size. A dynamic size means the size can be dynamically change up to the maximum size specified. At initial, the disk won’t consume all the disk size, but everytime it is filled with data it will grow bigger until the maximum size it is allowed. The disk can’t grow any larger after reach disk maximum size.

As stated, a disk need a maximum capacity. VirtualBox use Mega Bytes as capacity unit. Therefore, to create a 10GB disk we specify the size as 10*1024=10240MB.

To create a static size (for example ArchSlack.vdi):

VBoxManage createhd --filename ArchSlack.vdi --size 10240 --variant Fixed

To create a dynamic size (for example ArchSlack.vdi):

VBoxManage createhd --filename ArchSlack.vdi --size 10240

See Recognized OS

VirtualBox support some Operating System. We can see what OS supported by:

VBoxManage list ostypes

If we want to install an OS on VM, search whether your OS is recognized. Once you find it, note what ID it use. For example Ubuntu 64 bit is having ID Ubuntu_64. If you don’t find one, see what family type for your OS and choose generic type for those family. For example: Slackware64 is not listed there, but we know that Slackware64 is a 64-bit Linux. Thus we use close / similar system we can find, I choose ArchLinux_64.

See VMs

Querying Info

We can know some information for a particular Virtual Machine. The information is specific to the VM. For example we want to query information about ArchSlack, we can invoke:

VBoxManage showvminfo ArchSlack

Existing VMs

We can too list what VM on our system. Technically, it list any registered VM which usually located inside “$HOME/VirtualBox VMs/”.

VBoxManage list vms

If we want to query detail information for all vms (similar to VBoxManage showvminfo to all vms), we can use:

VBoxManage list vms --long

Running VMs

apart from existing VMs, we can also see what VM running on our system.

VBoxManage list runningvms

Create (Register) a VM

In this section, we will create a Virtual Machine. The VM will recognized as ArchSlack. Remember that Slackware will use ArchLinux_64 configuration. Here we write ArchSlack after –name and ArchLinux_64 after –ostype.

VBoxManage createvm --name ArchSlack --ostype ArchLinux_64 --register

If you open your VirtualBox GUI, you will find new entry, ArchSlack. If so, we have sucessfully create our Virtual machine.

Add Device and Controller

Generally, devices can be divided into SATA or IDE. A new created VM doesn’t have both so if we have a fresh VM, we should add it first.

SATA

We will add a SATA Controller and register it to our ArchSlack as “SATA Controller”. After Controller is registered, we can add various devices, such as hard disk. Here is the example:

[sourcecode language="bash"]
VBoxManage storagectl ArchSlack --name "SATA Controller" --add sata --controller IntelAHCI
VBoxManage storageattach ArchSlack --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium ArchSlack.vdi
[/sourcecode]

IDE

Other than SATA, there is IDE. Like SATA, we can create IDE Controller and use it to hold some device. In this snippet, we will attach DVD drive to “IDE Controller”. Later we will insert an ISO to this “DVD drive”. Here is the snipper:

VBoxManage storagectl ArchSlack --name "IDE Controller" --add ide
VBoxManage storageattach ArchSlack --storagectl "IDE Controller" --port 0 --device 0 \
--type dvddrive --medium Slackware64.iso

To eject the DVD, we can simply use this:

VBoxManage storageattach ArchSlack --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive \
--medium none

Misc System Setting

These should be self explaining.

VBoxManage modifyvm ArchSlack --ioapic on
VBoxManage modifyvm ArchSlack --boot1 dvd --boot2 disk --boot3 none --boot4 none
VBoxManage modifyVM ArchSlack --memory 1024 --vram 128
VBoxManage modifyvm ArchSlack --nic1 bridged --bridgeadapter1 e1000g0

Start VM

To start a VM, we must use the name we register on VirtualBox. In this case we use ArchSlack:

VBoxManage startvm ArchSlack

Controlling Running VM

Once a VM running, we still can control the running VM on terminal. Well, there is no command such as stopvm to stop the VM, but we can manipulate a VM into three state: pause, running, poweroff.

Pause

In this state, VM is still running but in pause state. Pause state means the VM is not responding any input and not giving any output to its environment. To pause ArchSlack, we can use:

VBoxManage controlvm ArchSlack pause

Resume

When a VM in pause state, we can make it back to running state. This is called as resume. To resume ArchSlack we can use:

VBoxManage controlvm ArchSlack resume

Poweroff

A running VM can be forced to shutdown. We can power off ArchSlack by invoking:

VBoxManage controlvm ArchSlack poweroff

Snapshots

Snapshot can be imagined as a portion or “snapshot” of condition when VM is running. VirtualBox will save state or condition happen currently on specified machine. The saved snapshot then can later be recovered.

Take a snapshot of ArchSlack and save it as ArchSlack001:

VBoxManage snapshot ArchSlack take ArchSlack001

Restore snapshot ArchSlack001 to ArchSlack:

VBoxManage snapshot ArchSlack restore ArchSlack001

Remove (Unregister) VM

A registered VM can be unregistered / removed from VirtualBox. When we do this, VirtualBox will delete corresponding configuration file (in this case ArchSlack.vbox).

VBoxManage unregistervm ArchSlack

QEMU on Windows

December 5, 2015 | Article | 1 Comment

QEMU is an emulator for various CPUs. QEMU can emulate Operating System like Linux, Windows, FreeBSD, etc such as Virtual Box and VMWare do. But unlike other emulator, QEMU can also emulate machine. Hence you can get an ARM “run” on top of your machine.

When used as a machine emulator, QEMU can run OSes and programs made for one machine (e.g. an ARM board) on a different machine (our machine) by using dynamic translation with very good performance. When used as a virtualizer, QEMU achieves near native performance by executing the guest code directly on the host CPU.

On previous article we have discuss many things on QEMU such as: Installing Slackware on QEMU and also Installing QEMU on Slackware64. In this article we will discuss something different. We will discuss about how to install QEMU on Windows using Windows 8 64-bit. Although I use Windows 8 64 bit as example, you can also build QEMU on your 32-bit Windows machine.

Obtain the Materials

QEMU binaries for Windows is officially not supported and not maintained by QEMU. To obtain QEMU for Windows we can get the unofficial binaries from some contributors. Here we have some providers:

  1. Prashant Satish’s build
  2. Eric Lassauge’s build
  3. Takeda Toshiya’s build
  4. Stefan Weil’s build

Thanks for your work for providing the binaries.

In this article, I will use QEMU 1.5.2 which is provided by Prashant Satish. You can do direct download the specified file here.

Make sure you have application that can open and extrace .lzma type. I recommend you to use 7zip for this purpose.

Installation

Well, there is no special treatment for QEMU installation. First, extract the archive (in this case: qemu-1.5.2-win32.tar.lzma). You will get a directory qemu and some binaries inside. Let’s move this directory to C: thus we will get C:\qemu now.

Next, we need to “register” qemu binaries so Windows can execute them.

Now open Control Panel. Now choose Edit the system environment variables. If you can’t find it, enter Control Panel\System and Security\System to address bar and choose Advanced system settings. Click on Environment Variables button and edit path. Add following: “;C:\qemu” without quote “.

Open up command prompt, and let’s try to boot QEMU.

qemu-system-i386

You should see a new window appear like a new PC just booting up.

qemu_window

Installing Windows XP on QEMU

December 5, 2015 | Article, Labs | No Comments

On other article we have discussed about running Debian ARM on QEMU, and also Slackware ARM on QEMU. Now,  in this article we will attempt install Windows XP on QEMU.  In this article I use:

  1. Slackware64 14.0 as host OS
  2. QEMU
  3. Windows XP ISO / CD

Obtain the Materials

Make sure you have install QEMU. If you have not installed it yet, you can read article here.

Another thing we need is Windows XP ISO or CD for installation. Make sure you have product key for activation. This article won’t give you link to obtain any of them so you should find them by yourself. Either ISO or CD is OK, just pick one.

Preparing the Environment

First we need to set the environment before do installation.

Make Working Directory

All progress we did will be stored on a single directory. You can create any directory but for this article I assume you create it on ~/QEMU/WinXP directory. Also, save ISO file, if you do installation by ISO file, to this directory.

Create Disk

We need to create a raw hard disk. At minimum, 4GB disk is sufficient. In this article I use 6GB disk. You don;t need to partitioning your disk. All work will be done on an image disk. The image can be created by qemu:

qemu-img create -f raw WinXP.img 6G

On above command, we create a disk with 6GB capacity. The -f switch tell qemu to create a raw disk. The disk then stored as an image file with filename WinXP.img

Installation

First we need to boot the ISO. On our working directory, invoke following command:

qemu-system-i386 -m 512 -hda WinXP.img -cdrom winxp_n_sp2.ISO -boot d

The platform we use is i386 or generic Intel x86 CPU therefore we use qemu-system-i386 to boot. Here are the explanation of all arguments we put:

  • -m 512: allocate 512 MB of RAM for virtual machine
  • -hda WinXP.img: Search for WinXP.img on current directory and use it as hard disk.
  • -cdrom winxp_n_sp2.ISO: Use ISO file with filename winxp_n_sp2.ISO on current directory. The name may be vary and you should adjust it with your ISO’s name. If you use installation CD, insert your CD and replace winxp_n_sp2.ISO with /dev/cdrom or whatever your CD device file node is.
  • -boot d: instructs QEMU to let the virtual machine boot from the (virtual) CD-ROM drive we’ve specified using -cdrom

A window might appear and then you can see the installation CD is now booting. You can continue with usual installation procedure, it’s not different compared to when you install to actual machine. And it still ask you about product key so you better enter the correct code.

Once the installation finish, you will got you Windows XP running on QEMU. Now, whenever you want to boot Windows XP, you can at minimum invoke following command:

qemu-system-i386 -m 512 -hda WinXP.img

Now, happy hacking 😀

Here are some screenshots

Installing Android 4.0 in VirtualBox

December 5, 2015 | Article | No Comments

Android, the popular Operating System for smartphones, now come in handy on PC. Some folks at Android-x86 project had port this little Green Buddy into PC. And thanks to them, we can enjoy the Android on our PC.

In this article, we will discuss about Android x86 installation on VirtualBox. For this, I use:

  1. Slackware64 14.0, although any Operating System is fine at least it can run VirtualBox
  2. VirtualBox.
  3. Android x86 ISO file

Obtaining the Materials

As said, we will do installation of Android on virtual machine using VirtualBox. Thus you have to make sure VirtualBox is installed and enable to run properly. For Slackware64, I have create a separated article about how to install VirtualBox on Slackware.

Another material we need is the Android x86 ISO itself. The ISO is provided by http://www.android-x86.org, the official site. The project had made many builds of Android OS for a quite. You can see many version with many architecture supported by them. The one we use is android x86 4.0 RC2 for asus laptop.

For some version provided there, they don’t work very well in VirtualBox. For example the “EEEPC” image for Android 4.0 has issues with the audio drivers and the network (it has no Ethernet support built in), etc. But fortunately, There is an ISO image which has been custom made to match with VirtualBox which I found on another people site. Although he said this is not his made, but thanks Kirsle! You can download the ISO from this site!

Create the Virtual Machine

Now come to the main business. Create a new machine for Android with this (minimum) specification:

  • Machine Name: “Android x86 ICS” (or anyname you want)
  • Machine Type: “Linux
  • Machine Version: “Linux 2.6”
  • Memory: 256 MB (but I use 1024 MB)
  • Hard disk: 12 GB (12 GB is enough, but mine is 16 GB)

Other setting on my Virtual Machine:

  • Networking:
    • Type: NAT
    • Adaptor: “Intel Pro/1000 MT Desktop (8254EM)”
  • Audio: Intel AC’97
  • Storage Layout:
    • IDE Controller: CD Device
    • SATA Controller: Hard disk
  • Video Memory: 16 MB

Boot and Install

Run the virtual machine, you should then see something similar to this:

android1

If you want to try the live CD, you can choose “Live CD – VESA mode” on boot menu. You will then see the screen like this:

android3

Another screenshot for Android x86 4.0:

android2

If you decide to install it, in boot menu (you should restart the machine if you are on Live CD mode) choose “Installation – install Android-x86 to harddisk”. Then you will see bunch of text on console and then be brought to partition menu. OK, get ready.

In this article we will use all the space we have and create only partition. You can also create more than one partition, but we won’t cover that here.

Choose “Create/Modify Partitions” which leads you into cfdisk. To do so do the following:

  1. Choose “[New]”
  2. Choose “[Primary]”
  3. Press enter to accept the default partition size
  4. Choose “[Bootable]”
  5. Choose “[Write]”
  6. Type “yes” to confirm writing
  7. Choose “[Quit]”

Now choose to install on the “sda1 device Linux VBOX HARDDISK”. Format it to “ext3”. Confirm “yes” on formatting. Confirm “yes” when it asks to install GRUB bootloader. Confirm “yes” when it asks to mount /system as read-write.

Now create a fake SD card when it prompts. I made 2074MB (the maximum allowed).

Reboot! Make sure you detach the ISO image from the virtual machine and boot the installed OS. If you still see “Installation” option again, then you are booting form ISO.

Disable Mouse Integration

To interact with GUI, you need to disable mouse integration. This can be done by choosing the “Machine” menu in the VM window and clicking “Disable Mouse Integration”. Another way is pressing HostKey + I.

Installing Virtualbox on Slackware

December 5, 2015 | Article | 4 Comments

Virtualbox, one of player on Virtualization Technology. Developed by Sun Microsystem (now owned by Oracle). This article will discuss about Virtualbox, how to install and configure on Slackware machine.

In this article I use:

  1. Slackware machine, mine is Slackware64 14.0 with multilib support (non-multilib or even 32-bit system is OK)
  2. Virtualbox 4.2.0 (provided by SlackBuilds.org)
  3. or Virtualbox 4.2.6 (provided by Oracle)

You can use method slackbuilds or binary provided by Oracle. both are OK. The advantage of using binary provided by Oracle is you can choose to install latest version.

Enabling Virtualization Support

There would be such a waste if you have installed Virtualbox but you have not enabled the virtualization support, or even you don’t have virtualization support (but it’s rarely happen at this time).

To make sure you have it, restart your machine and enter BIOS / UEFI mode. Make sure you have enabled Virtualization. It depends on the BIOS manufacture.

Method 1: Slackbuild Installations

Stage 1: Install acpica

ACPI CA is a collection of program which includes:

  1. iasl, an ASL compiler/decompiler
  2. acpisrc, a source code conversion tool
  3. acpiexec, a user-space AML interpreter
  4. acpixtract, convert ascii ACPI tables to binary

Why ACPI CA? ACPI CA is needed to be installed as it is a dependency of VirtualBox.

Now download the materials from here.

To build ACPI CA, we need to download following:

  1. ACPICA for unix
  2. acpica.tar.gz

Now place the material into 1 directory and extract the acpica.tar.gz file. You should find a newly created directory acpica. Open it and copy the acpica source to it. Run the slackbuilds script and wait. It should make a new package on /tmp/ directory. Install it using upgradepkg. The complete commands can be found here:

tar -zxvf acpica.tar.gz
mv acpica-unix2-20120420.tar.gz acpica/
cd acpica
./acpica.SlackBuild
upgradepkg --install-new /tmp/acpica-*.tgz

Stage 2: Install VirtualBox Kernel

Virtualbox kernel a package for virtualization needed by VirtualBox. It is a kernel module. Therefore when you build one with current machine and then change the kernel version, you must rebuild this packages. To build the package for a kernel different from the running one, start the KERNEL variable as in

KERNEL=3.7.5 ./virtualbox-kernel.SlackBuild

If you have built virtualbox with HARDENING=no, then you have to do the same for virtualbox-kernel.

Download required materials from here.

The one you need to download are:

  1. virtualbox-kernel source
  2. virtualbox-kernel.tar.gz

Do following:

tar -zxvf virtualbox.tar.gz
mv virtualbox-kernel-4.2.0.tar.xz virtualbox-kernel/ 
cd virtualbox-kernel
./virtualbox-kernel.SlackBuild 
upgradepkg --install-new /tmp/virtualbox-kernel-*.tgz

Stage 3: Install VirtualBox

You can download the material here.

To build a Virtualbox, you need to download following:

  1. VirtualBox 4.2.0 source
  2. VBoxGuestAddition 4.2.0 iso
  3. UserManual.pdf
  4. SDKRef.pdf
  5. SlackBuild script

Now do the following (change it if necessary):

tar -zxvf virtualbox.tar.gz
mv virtualbox-kernel-4.2.0.tar.xz virtualbox/
mv UserManual.pdf virtualbox/
mv SDKRef.pdf virtualbox/
mv VBoxGuestAdditions_4.2.0.iso virtualbox/
cd virtualbox
./virtualbox.SlackBuild 
upgradepkg --install-new /tmp/virtualbox-*.tgz

Post Installation

Once you complete all the steps, you have successfully install VirtualBox.

But, for running VirtualBox you need to do something more. You need to run virtualbox-kernel if you want to run virtualbox. Just invoke /etc/rc.d/rc.vboxdrv start before running VirtualBox. Make sure you have flag it as executable.

You can also create a simple script like this and place it to any directory recognized by shell. In my case I place it at /usr/bin as vboxmgr and whenever I want to start VirtualBox I will start virtualbox-kernel by typing vboxmgr start.

#!/bin/sh

case $1 in
        "start")
                        /etc/rc.d/rc.vboxdrv start
        ;;
        "stop")
                        /etc/rc.d/rc.vboxdrv stop
        ;;
        "restart")
                        (/etc/rc.d/rc.vboxdrv stop) && (/etc/rc.d/rc.vboxdrv start)
esac

Method 2: Using Binary Installation by Oracle

Using this method we can download binary provided by Oracle. The package can be download at this page. But unfortunately, there are official support for Slackware. Therefore we need to download the one which supported by all distribution. In the time of writing this article, the latest installer version is VirtualBox 4.2.6 which can be downloaded from here for 64-bit version. Do you want 32-bit version? Download it here.

Just run the installer and you have done!

Happy hacking 😀

Social media & sharing icons powered by UltimatelySocial