Tag Archive : virtualbox

/ virtualbox

Installing Haiku on VirtualBox

December 9, 2015 | Article | 1 Comment

In this article, we will discuss about Haiku 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. Haiku iso file

Obtaining the Materials

As said, we will do installation of Haiku 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 Haiku ISO itself. Go to Haiku’s download page. The latest version is R1/Alpha 4.1 which is relased on November 14th, 2012. Haiku team provide three way to taste Haiku, which are: Anyboot, ISO, and preloaded image file. As our concern is installation Haiku to VirtualBox, choose the ISO. The iso file itself is archived by zip and xz format. I suggest you to download the iso file from the closest area to you. Whatever format you download, extract the content. There you should get a directory with two files: haiku-r1alpha4.iso and release_notes_r1alpha4.1.txt. Next we will refer the iso as haiku.iso.

Create the Virtual Machine

Now come to the main business. Haiku doesn’t has relation to Linux, Unix, Mac, or even Windows. Haiku is close relative (but not too close) to BeOS. To emulate Haiku in VirtualBox, create a virtual machine using following specification:

  • Machine Name: “Haiku” (or anyname you want)
  • Machine Type: “Other”
  • Machine Version: “Other/Unknown”
  • Memory: 256 MB (but I use 512 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

Also, don’t forget to mount the iso file to virtual CD/DVD drive.

Boot and Install

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

haiku1

Choose your preferred language. Our goal is again, install Haiku to our machine. Therefore, choose “Run Installer” button. You should get a “warning”. Haiku is alpha software, so you should have acknowledge this πŸ™‚

haiku2

And then, finally, the simple installation wizard dialog. The installation is quite simple and straightforward.

haiku3

Because we create this virtual machine from scratch, then the disk has no partition yet. We should create one first. Click on Setup partition button and there should be a new dialog appear.

haiku4

The DriveSetup window should detect two mediums, one is our CD-Rom drive, and another is a “hard drive” for our virtual machine. Select the hard drive. It is blank (raw) now, therefore we should create a new partition. Navigate to Partitions -> Format -> Be File System. I want to use all the space, so let’s make it. Now we have the disk partitioned.

haiku5

After finish partitioning, close the DriveSetup dialog. You should notive a square left to DriveSetup. Press it and the dialog now disappear. You should see this dialog clearly.

haiku6

Make sure the combobox next to Onto is filled with our newly created partition. Click on Begin button to begin the installation.

haiku7

The installation will took place. It should be quick, but it is also depend on your host system and the resource you give to Haiku. When the installation finished, Haiku will notify us that it need to be restarted. Click on Restart button if you are ready.

Once Haiku is restarted, you will see Haiku desktop with some icons there. Haiku will also adjusting and updating some things inside.

haiku9

And here we have, Haiku.

haiku10

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

  1. Slackware64 14.0 as host
  2. VirtualBox 4.2.6

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 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 Preloaded with VirtualBox. Upon finish downloading, extract the content which you will get a directory named ReactOS-0.3.15-VBox. 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, ReactOS.vmdk, and ReactOS.vbox.

The ReactOS.vmdk is virtual disk format originally used by VMware. But yes, VirtualBox can use it too.

ReactOS.vbox is the VirtualBox’s file for referencing the virtual machine. In this project we have following specification:

  1. Type: Microsoft Windows XP
  2. RAM 512MB
  3. Network adapter is connected using NAT
  4. ReactOS disk is 226MB of 10GB available (dynamic)

Boot and Testing

Back to ROSdir.

Double click the project file, there you should open Oracle and see a new Virtual Machine installed. However this is not in my case. VirtualBox failed to open virtual machine, it cannot register the DVD image for VBoxGuestAdditions.iso because it is already exists.

vbox_react
Uh oh!

If you face similar problem, then navigate to File -> Virtual Media Manager. There you should see a dialog. Click on tab optical disks. Remove it. Don’t worry the disk won’t be deleted. Then you can double-click again the .vbox file.

Just start the VM, we are done! Seriously πŸ™‚

Testing and debugging an operating system require an environment. Many people prefer to use emulator and virtualization software like QEMU, VMware, or VirtualBox for this job. However, testing a software build for that OS which run on top of virtualization require a method to copy files between host and the guest system. Software such as VirtualBox and VMware have a feature which enable user to activate shared directory. However not every operating system can do this because this feature act as device driver or kernel module. Moreover, QEMU doesn’t have this. The best and practical way to copy file on QEMU is copy all files into .iso images which is accessible by internet. Another way is mount the virtual hard disk or the disk image, which we will do in this article.

As the title suggested, we will discuss the way in various host operating system. Therefore, materials I use are:

  1. Slackware64 14.0 (Linux)
  2. Windows 7 32 bit (Windows)
  3. QEMU 1.4.0

Linux

Most linux distribution allow virtual disk mounting using mount command. The disk image should be mounted into a specific directory, let’s say /media/MyOS. Most of the operation need root privilege, so acquire root privilege before we do.

mkdir /media/MyOS

Make sure your virtual image file is in RAW format. If you think your disk image is in another format, use following command:

qemu-img convert <image-file> -O raw <image-file.raw>

Mounting the disk image is simple thing, as simple as mounting another storage device. Note that the actual partition start from offset 32256, after some structure on the disk such as MBR, partition table, etc. The following example assume you are using FAT as file system.

mount -o loop,offset=32256 <image-file> /media/MyOS -t vfat

The 32256 comes from the start of the very first partition * the size of a block. This is because before the first partition there are some data such as MBR. So if your first partition start from block 2048, multiplying it will result in 1048576. Of course the partition should have been formatted with the preferred format.

If the disk has several partition, and you want to mount specific partition (not the first) then you should change the offset to the start of the partition.

To unmount is even easier.

umount /media/MyOS

Windows

Basically, Windows doesn’t provide such powerful tools like Linux does. However, we can always use third party’s software. Like in Linux section, in this section our goal is to mount raw images.

OSFMount

OSFMount allow local disk image mounting in Windows with a drive letter (E:/, F:/, G:/, etc). You can download OSFMount here.

P2 eXplorer

Another tool which can be downloaded here. Note that it is not free product, but you can always use the demo version.

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

Social media & sharing icons powered by UltimatelySocial