Tag Archive : virtualization

/ virtualization

Running Debian MIPS Linux in QEMU

December 11, 2015 | Article | No Comments

Have you ever want to try system other than your PC? MIPS for example.

As a reverse engineer, I sometimes want to run a MIPS Linux system so that I can observe, develop, and testing somethings. However, I don’t have much room for another device, so virtualization might be a solution.

In this article we will try to run MIPS Linux on QEMU. In specific, Debian MIPS Linux, with following materials used:

  1. Slackware64 14.1
  2. QEMU 2.1.50

The article written here should be as generic as possible so I hope it can be used for different setup you use.

Obtain the Materials

Refer to this article to build a QEMU, if you don’t have one: Installing QEMU from Source

Next, we need to download the kernel images and a disk image which has Debian installed there. Go to this site to download. The ‘mips’ directory is for Big Endian MIPS and ‘mipsel’ is for Little Endian one. Choose what you want but in this case I will download both of them. In specific, we will test kernel version 3.2.0 (denoted as vmlinux-3.2.0-4-5kc-malta) with Debian Wheezy (denoted as debian_wheezy_mipsel_standard.qcow2)

At this point, we have (at least):

  1. QEMU installed
  2. Debian kernel
  3. Disk Image with qcow2 format.

Setup Bridged Networking

In order to make QEMU environment connected to the network, we need to do some additional setup.

Now create the two new files, /etc/qemu-ifup and /etc/qemu-ifdown. Make sure you give them executable permission. Also make sure you have right configuration, like GATEWAY and BROADCAST address. Also pay attention to the USER. It is a username you should specify when you want to run qemu.

#!/bin/bash
ETH0IPADDR=192.168.1.100
GATEWAY=192.168.1.1
BROADCAST=192.168.1.255
USER=xathrya
 
# First take eth0 down, then bring it up with IP address 0.0.0.0
/sbin/ifconfig eth0 down
/sbin/ifconfig eth0 0.0.0.0 promisc up
 
# Bring up the tap device (name specified as first argument, by QEMU)
/usr/sbin/openvpn --mktun --dev $1 --user $USER
/sbin/ifconfig $1 0.0.0.0 promisc up
 
# Create the bridge between eth0 and the tap device
/usr/sbin/brctl addbr br0
/usr/sbin/brctl addif br0 eth0
/usr/sbin/brctl addif br0 $1
 
# Only a single bridge so loops are not possible, turn off spanning tree protocol
/usr/sbin/brctl stp br0 off
 
# Bring up the bridge with ETH0IPADDR and add the default route
 
/sbin/ifconfig br0 $ETH0IPADDR netmask 255.255.255.0 broadcast $BROADCAST
/sbin/route add default gw $GATEWAY

and

#!/bin/bash
 
# Bring down eth0 and br0
/sbin/ifconfig eth0 down
/sbin/ifconfig br0 down
 
# Delete the bridge
/usr/sbin/brctl delbr br0
 
# Bring up eth0 in "normal" mode
/sbin/ifconfig eth0 -promisc
/sbin/ifconfig eth0 up
 
# Delete the tap debice
/usr/sbin/openvpn --rmtun --dev $1

To starting network bridge, just invoke

/etc/qemu-ifup tap0

and then invoke

/etc/qemu-ifdown tap0

to stop it.

Running the Debian MIPS

After all preparation we have done, it’s time for actual thing.

Go to the directory where we store kernel and disk image, for example $HOME/debian-mipsel, and then invoke following command:

qemu-system-mips64el -net nic -net tap,ifname=tap0,script=no,downscript=no \
-M malta -kernel vmlinux-3.2.0-4-5kc-malta -hda debian_wheezy_mipsel_standard.qcow2 \
-append "root=/dev/sda1 console=tty0"

We can also create a script to simplify it.

#!/bin/bash

qemu=qemu-system-mips64el
path="$HOME/debian-mipsel/"
hda="$path/debian_wheezy_mipsel_standard.qcow2"
kernel="$path/vmlinux-3.2.0-4-5kc-malta"
iface=tap0

echo "Stopping eth0, starting tap0"

/etc/qemu-ifup tap0 || quit 1 "Failed to start tap0"

echo "Starting Debian MIPS"

$qemu -net nic -net tap,ifname=$iface,script=no,downscript=no \
-nographic -M malta -kernel $kernel -hda $hda -append "root=/dev/sda1 console=tty0"

If everything goes well, you should see Debian is booting and then greeted with sweet login prompt.

Further Configuration

It’s nice to work with QEMU window. But you should admit taht QEMU console is very limiting, so you need SSH connection to do most of your work. You can, by installing OpenSSH inside Debian system using apt:

apt-get update
apt-get install openssh-server

Installing QEMU from Source

December 11, 2015 | Article | 1 Comment

Edit: I had update the article to build from latest package and testing.

You might notice that I had written an article before about building QEMU from source. That one is QEMU KVM (Kernel Virtual Machine).  As per version version 1.3 QEMU-KVM is merged to upstream QEMU project therefore the QEMU-KVM is no longer maintained. It’s been done long time ago, actually.

QEMU is a generic and open source machine emulator and virtualizer.

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. By using dynamic translation, it achieves very good performance.

In this article we will discuss about installing QEMU and use following requirement:

  1. Slackware64 14.0, although any version is OK
  2. latest qemu source code

There are two options for us: building the stable release or building the development code.

Obtain the Source Code

Between the stable release source code and development code, which one is suitable for us?If you want to download the latest stable release, you can obtain it from qemu official site here.

At the time of writing this article, the latest stable version is 2.5.0 (per March 20th 2016). You can download it by direct link here. http://wiki.qemu-project.org/download/qemu-2.5.0.tar.bz2

Once you have done downloading, uncompress it with:

mv qemu-2.5.0.tar.bz2 /usr/src
tar -jxvf qemu-2.5.0.tar.bz2
cd qemu-2.5.0

If you want to download the development code. You can clone the git repository by:

cd /usr/src
git clone git://git.qemu-project.org/qemu.git
cd qemu

For any option we choose, we should have qemu source code now.

Compilation

At this point we are inside the source directory. Qemu support many features. We can list the feature by

./configure --help

For now, we just want a working Qemu with debug enable and install it to /usr. First, create a directory build. This directory will be used for all building process we do.

mkdir build
cd build

Next we do usual chant:

../configure --enable-debug  --prefix=/usr --enable-modules
make -j4

If you want to know my build, here it is:

../configure --enable-debug --prefix=/usr --enable-modules --enable-libusb \
--enable-usb-redir --enable-spice --enable-smartcard

If you like, you can go to next section for testing. If not, you can install QEMU by

make install

Congratulation, you had installed Qemu.

Testing

Testing BIOS

To test if default settings works.

x86_64-softmmu/qemu-system-x86_64 -L pc-bios

Testing KVM

To test if KVM is working

x86_64-softmmu/qemu-system-x86_64 -cpu host --enable-kvm -L pc-bios

To test with Linux image

wget http://wiki.qemu.org/download/linux-0.2.img.bz2
bunzip2 linux-0.2.img.bz2
x86_64-softmmu/qemu-system-x86_64 -cpu host --enable-kvm -display gtk linux-0.2.img

Creating Multiple Networks on VMware Player

December 9, 2015 | Article | No Comments

In VMware Player, there are three network options for guest VMs: bridged network, NAT network, and host-only network.

vmware-1

What if you want to create multiple isolated networks, running the VM and have the networks run available at once? Each of which is reachable via different network interfaces attached to the VM. Surely this is interesting, but if the network choices are limited to the one above three options, we can’t make our idea real.

Therefore, in this article we will discuss about how we can “hack” VMware Player so it can accommodate our idea.

The Theory Behind

The feature we use is “LAN segments”. Using this, we can define multiple LAN segments, each of which represents an isolated virtual LAN. We can then add our VM as many LAN segments (corresponding network adapters) as we want. Both VMware Workstation and VMware Player have this feature so you can apply it to VMware Workstation too. However, on Linux it seems that LAN Segments is not shown by default.

Each LAN segment act as a VPN (Virtual Private Network). This way, more than one isolated network can be formed.

Creating LAN Segment

In order to create and assign a LAN segment to VMware Player VM, first create a new VM instance with two network interface (one bridged and the other NAT interfaces) using Virtual Machine Wizard. Do not turn on the VM at this point. Instead, open up .vmx file of the VM and edit it as follows.

Search for the lines that reads “ethernet1.xxxxx”. This is configuration for network interface eth1

ethernet1.present = "TRUE"
ethernet1.connectionType = "nat"
ethernet1.virtualDev = "e1000"
ethernet1.wakeOnPcktRcv = "FALSE"
ethernet1.addressType = "generated"

Currently eth1 is set to use NAT. We will reconfigure it so that it uses a LAN segment instead. For that, change the above configuration as follows:

ethernet1.present = "TRUE"
ethernet1.connectionType = "pvn"
ethernet1.pvnID = "52 dd bc d5 36 19 1b 6b-0f f1 fb 1c 4c ac 44 f7"
ethernet1.virtualDev = "e1000"
ethernet1.wakeOnPcktRcv = "FALSE"
ethernet1.addressType = "generated"

As seen there, two changes made. First, ethernet1.connectionType was change to “pvn” (Private Virtual Network). Also, there is a new entry, ethernet1.pvnID which identifies the LAN segment that the VM will be attached to. You can fill in any arbitrary pvnID in the same alphanumeric format; it will be regenerated by VMware Player later on.

Once changes are saved to .vmx file, open the guest machine’s VM settings on VMware Player. Now you will notice that LAN segment configuration menu magically appears on VMware Player GUI, as shown below.

vmware-2

If it isn’t shown up yet, close VMware Player and start it up again.

From the drop down menu of LAN segments, you can choose “LAN Segment 1″ which was created by our manual editing of .vmx file. You can also create as many LAN segments as you want, by clicking on “LAN Segments” button, which will show you a LAN segment management interface.

All the VMs that are attached to the same LAN segment are physically on the same layer-2 network. VMs that are assigned to different LAN segments are physically separated.

Note that there is no pre-configured DHCP service running on the LAN segments you create. Therefore, if you want to have your VM assigned a DHCP IP address from a given LAN segment, you will need to run a DHCP server on one of your VMs on the same LAN segment. Alternatively, you could use a static IP address.

Introduction to User-Mode Linux

December 9, 2015 | Article | No Comments

If you are practicing for network engineering, there are many options to setup your own virtual network lab. GNS3, Netkit, Marionnet, VNUML, just name a few. All of those tools are great way to setup network lab. They are great for learning how to build network and practice various network topology in easier way. Yes, they are not low level. They keep us from customizing our linux node used in network lab. If we want true network with various setting and configuration, then we need dive deeper.

So imagine I want some nodes with different configuration. All configuration files (including the ones for the virtual hosts) are kept into one subdirectory and able to be modified while the lab was running. The node should start in few seconds. Is it possible? Well, let’s discuss User-Mode Linux. Well, it’s not fancy solution like other tools are. More like a home-made solution to match some of things you need.

User-Mode Linux, as hinted by the name, is a linux kernel that run as a process on another GNU/Linux operating system. It is a secure way of running Linux as a process. We can call it as type of virtualization but has different approach compared to VirtualBox or VMWare. It is closed to containerization but not the same. We run buggy software, experiments with new Linux kernels or distributions, and poke around in the inernals of Linux, all without risking main Linux.

User-Mode Linux and Virtualization Technology

Technology-wised, there are two types of virtualization technologies. They are full-virtualization and containerization, both offers some advantages over the other. The full virtualization, as in VirtualBox, VMWare, Xen, create a virtual resources or emulate physical platforms from CPU to the peripherals in which Linux will run. The containers, as in chroot, jail, docker, rkt, are sharing the same OS kernel as the hosts and run in some kind of isolation.

UML is closely related to the containers. However, UML itself is a fully functional Linux running as a process, make it different to containers. In the perspective of host, UML is like another process, running and ask for resources. From the perspective of UML, it is a kernel and give services to its processes. The UML itself is a modified copy of Linux kernel. Therefore, we can say that UML is a kernel as well as a userspace program in the same time.

Grab the Materials

There are two components of UML: the kernel and the filesystem. The kernel is the vital part. You can obtain the kernel here: http://uml.devloop.org.uk/

That links provide a kernel up to certain version. All are available in 32-bit and 64-bit architecture.

You can download a filesystem on here: http://fs.devloop.org.uk/

For this article, I will use Kernel version 3.11.2 64-bit and file system Slackware 12.x 64-bit.

We can create our own UML and filesystem, but that’s for another time.

Extract the kernel and filesystem. Here I have:

  1. kernel64-3.11.2
  2. Slamd64-12.1-root_fs

For the sake of simplicity, I will refer the kernel64 for the kernel we use and slamd64 for the filesystem.

First Boot

Let’s head to kernel first. Check and run the kernel:

chmod +x kernel64
./kernel64 mem=512M

It is quite straightforward. I run kernel and having virtual RAM about 512MB. Don’t worry if you encounter a kernel panic. It’s fair to assume that we didn’t specify any root filesystem (and that’s right). Now, let’s boot UML in proper way. This time, we will boot kernel and specify a filesystem.

./kernel64 ubda=Slamd64 mem=512M

Now you can see the familiar login prompt on your terminal.

Add a Network Support

To add network capability to UML node, we have to create a new TAP interface. We should allocate the TAP device to UML instance. Here, on you host Linux:

tunctl -t tap0

tap0 is the device name of our new interface.

Next, assign an IP address to it, assuming the IP address is 192.168.135.1 and on 192.168.135.0/24 network. Of course you need to adjust it to your network.

ifconfig tap0 192.168.1.1

Then modify the kernel invocation, by:

./kernel64 ubda=Slamd64 mem=512M eth0=tuntap,tap0,MAC_ADDR,IP_ADDR con0=fd:0,fd:1

There is also an option to utilizing DHCP daemon on the host to gives IP automatically to UML nodes. For example we use dhcpd for DHCP daemon. Create a DHCP configuration file in ~/dhcp.conf. Let’s say we want to create network 192.168.135.0/24

default-lease-time 6000;
max-lease-time 72000;
option domain-name-servers 192.168.135.1;
option routers 192.168.135.1;
server-name "192.168.135.1";
ddns-update-style none;
subnet  192.168.135.0  netmask  255.255.255.0  {
   range 192.168.135.2 192.168.135.254;
}

Our DNS might not be 192.168.135.1 so we should make it to the real DNS server.

Start the DHCP server on tap interface.

dhcpd -cf ~/dhcpd.conf tap0

and then modify kernel command line to give UML access to this new network interface.

Add Routing

The previous section should allow communication between the host and the guest (UML node). In order for the guest to reach the outside world we must configure the routing table. It means we need to tell the host to route the packets coming to/from the guest. It can be achieved by modifying firewall rules. However the very first thing to do is to make sure host is allowed to forward packets.

Execute following command.

echo 1 > /proc/sys/net/ipv4/ip_forward

Then add firewall rules.

iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE
iptables -I FORWARD -i tap0 -j ACCEPT
iptables -I FORWARD -o tap0 -j ACCEPT

In the next occasion, we will discussing some labs for UML.

Testing the QEMU

December 9, 2015 | Article | No Comments

QEMU, a popular emulation and simulation application used for simulating most architecture, from embedded processor such as ARM to common x86_64 processor. QEMU is available to various host operating system: Linux, Windows. To test QEMU capability, we can provide it with a testing disk image which has a guest operating system inside.

In this article, we will list all testing disk image available for QEMU. You can download some of the guest image from QEMU website, including a simple 8MB image of a linux distro (which is meant primarily for testing and might lacks some drivers). We will also list other QEMU test disk image we found so far on this site.

You also might interested to basic guide about QEMU disk image:

  1. Mounting QEMU disk image

QEMU Disk Images

Collection of disk images which can be used to test system emulation.

linux-0.2.img.bz2 [ mirror ] Small Linux image containing a 2.6.20 Linux kernel, X11, and various utilities to test QEMU
odin1440.img [ mirror ] FreeDOS floppy disk image from ODIN
small.ffs.bz2 [ mirror ] Small NetBSD Image
minix204.tar.bz2 [ mirror ]
Minix 2.0.4
efi-bios.tar.bz2 [ mirror ]
EFI BIOS for QEMU
sparc-test-0.2.tar.gz [ mirror ]
SPARC Linux 2.6 test kernel and initrd disk image
arm-test-0.2.tar.gz [ mirror ]
ARM Linux 2.6 test kernel and initrd disk image
mips-test-0.2.tar.gz [ mirror ]
MIPS Linux 2.6 test kernel and initrd disk image
mipsel-test-0.2.tar.gz [ mirror ]
MIPS Little Endian Linux 2.6 test kernel and initrd disk image
coldfire-test-0.1.tar.bz2 [ mirror ]
Coldfire Linux 2.6 test kernel and initrd disk image
sh-test-0.2.tar.bz2 [ mirror ]
SH4 Linux 2.6 test kernel and initrd disk image
cris-axisdev88-img-linux2_6_33.tgz [ mirror ]
CRIS AXIS Devboard88 Linux 2.6 test kernel and initrd disk image
mb-s3adsp1800-linux-2_6_34_tgz [ mirror ]
Microblaze S3ADSP1800 Linux 2.6 test kernel and initrd disk image
ppc-virtexml507-linux-2_6_34.tgz [ mirror ]
PPC-440 Virtex-ML507 Linux 2.6 test kernel and initrd disk image
xtensa-dc232b_kernel_rootfs.tgz [ mirror ]
Xtensa Linux 2.6.29 test kernel and initrd disk image

QEMU User Mode Emulation

These executables can be used to test Linux user mode emulation

linux-user-test-0.3.tar.gz [ mirror ]
Distribution of shared libraries and various shell executables for almost all Linux target architecture that QEMU simulates. It is used to make regression tests on the Linux user mode emulation

Dynamic Code Analysis

This includes any test to detect memory leaks, reads of uninitialized memory, buffer overflows, or other forms of illegal memory access. Typically these kind of tests are done using Valgrind on a Linux host. Any of the disk images and executables listed above can be used in such tests.

# Simple i386 boot test (BIOS Only) with Valgrind
valgrind --leak-check=full --track-origin=yes --verbose qemu-system-i386

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.

If you have read my previous article about mounting QEMU Hard Disk Image, you should note that the partition should already have been formatted with a specific filesystem. This is bad if we just create a fresh QEMU disk image.

This article will discuss about how to format the partition inside QEMU disk image. The assumption made here is the disk image is fresh and no more operation than partitioning it. I assume you have at least one partition (such as FAT32, Linux, etc. Any!).

In this article I use:

  1. Slackware64 14.0 as host system
  2. QEMU 1.4.0

I also provide a small empty raw image for play around (see next section).

Obtain the Materials

You can download an empty disk image here

The compressed image size is 2MB and the extracted (the image itself) is 2GB.

The disk image has two partition (as seen on fdisk):

  1. W95 FAT32, start from 2048 , end on 268287. This will be formatted as FAT32.
  2. Linux, start from 268288, end on 4194303. This will be formatted as EXT4.

There is nothing special about this image. The process I did is common and you can achieve it by yourself:

  1. Create empty qemu image file
    qemu-img create -f raw xath-testsuite-ext3.img 2G

    The image is in raw format. This is important as it is the simple one.

  2. Create the partition using fdisk.

We also need a Linux ISO image. We will use Slackware mini install which can be obtained here. In the rest of this article, we will refer this as minislack.iso.

Process

What we will do are:

  1. Format the hard disk / QEMU disk image using Linux installer.
  2. Interrupt the Linux installer, stop QEMU, mount the QEMU image on Linux and clean it up.

Formatting

Boot the disk with QEMU and Slackware as first boot

qemu-system-i386 xath-testsuite-ext3.img -cdrom minislack.iso -boot d

Once booted, just press enter. Press enter again when you are asked for keyboard layout. You will be brought to a terminal. Login as root with no password.

Our disk image is recognized as /dev/sda. To format a partition as FAT32 use mkfs.vfat and to format it as EXT4 use mkfs.ext4.

We will try the second one and I will leave you with the first one for you to play with 😉

mkfs.ext4 /dev/sda2

Finishing

Now for final touch. Still using the Slackware on QEMU, mount the /dev/sda1 and /dev/sda2. Your goal now is to remove the content. After this point, we can finally say “done!”.

Congratulation!

Emulating Raspberry Pi using QEMU on Windows

December 9, 2015 | Article | No Comments

Previously, we have discussed installation of various Raspberry Pi‘s Operating System. All have been done on the actual board. But what if we are in situation where we can’t afford the board? Emulation sure is the way to experiment and QEMU open the possibility.

Although emulation can make our life easy, you can’t always rely on emulation. Remember that emulation trying to imitate the real hardware, but can’t be the one.

In this article, we will discuss about how to emulate Raspberry Pi board using QEMU. For this purpose I use:

  1. Windows 8 64-bit as host system
  2. QEMU 1.4.0
  3. Soft-Float Debian Wheezy with version 2013-05-29.
  4. OpenVPN

For Linux machine, you can go to this article instead.

Obtain the Material

Make sure you have QEMU installed. On Windows, you can follow this article.

Next, download the images. As stated above, we will use Soft Float Debian Wheezy. You can download it from Raspberry Pi’s official download page. The version I use is the 2013-05-29 or latest version per August 24th 2013 and can be downloaded here.

We also require linux kernel for QEMU. Download it from here.

Download and install OpenVPN. This will add a TAP 32 network adapter.

The Hardware – Overview

Before we go to next section, it is always a good idea to understand what system we want to work with. In this case, raspberry Pi. You can see the Architecture of Raspberry Pi for detail.

For the system we will create in using QEMU:

  1. ARM1176JZF-S, see the datasheet here
  2. Ethernet

Note that QEMU cannot emulate GPIO and GPU.

Also, to encapsulate network we need TAP network for full networking support. See next section.

Preparing the environment

Create a working directory. In this case, qemu-raspberry.

Extract the disk image and kernel image we have downloaded on previous section.

Now open “Network and Sharing Center” and click “Change Adapter Settings” in the left menu.

Rename the TAP 32 network adapter to just TA32 and double click the adapter. Do the settings like this (adjust with your setting):

Now bridge the adaptor with an active connection with the TAP32 adapter.

Next create a file raspberry.bat and fill with following:

qemu-system-arm.exe -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot \
-serial stdio -append "root=/dev/sda2 panic=1" -hda 2013-05-29-wheezy-raspbian.img \
-net nic -net tap,ifname=TAP32

Booting the disc image

Just double click the rasperry.bat and if you did correctly, you will get similar to this:

Installing Haiku on QEMU

December 9, 2015 | Article | No Comments

If previous article we discuss about installing Haiku on VirtualBox, this time we will discuss about how to install Haiku on QEMU. As proof of concept, I use:

  1. Slackware64 14.0 as host
  2. QEMU 1.4.0.
  3. Haiku iso file

Obtaining the Materials

As said, we will do installation of Haiku 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 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

It would be great if you create a working directory specially made for this purpose. Let’s call it HaikuDir under your home directory. Therefore, we will have ~/HaikuDir.

Haiku will be installed to a dedicated drive image. We will refer it as haiku.img. Approximately, 1000MB space at minimum is sufficient. We will make use of QEMU to create an image for us.

qemu-img create haiku.img 1000M

If you plan to install some application to try under Haiku, greater space is recommended.

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

qemu-system-i386 -m 256 -cdrom haiku.iso -hda haiku.img -boot d -localtime -serial file:haiku.log

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

  • -m 256 means we give 256MB of RAM. If you got plenty of RAM available and don’t mind share some, you can set this value higher.
  • -cdrom haiku.iso will create a cd rom drive to the virtual machine with haiku.iso loaded.
  • -boot d instructs QEMU to boot from the CD-ROM.
  • -localtime means the QEMU VM will use time provided by the host.
  • -serial file:haiku.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 haiku.iso -hda haiku.img -boot d -localtime \
-serial file:haiku.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.

If you need network connection, go add -net nic,model=ne2k_pci and -net user switches when calling qemu.

Boot and Install

qemu_haiku1

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

qemu_haiku2

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 🙂

qemu_haiku3

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

qemu_haiku4

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.

qemu_haiku6

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.

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.

qemu_haiku7

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

qemu_haiku8

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.

qemu_haiku9

Now, this is the tricky part. When we first launch QEMU, we say that qemu should boot the disk first. Thus, when we restarted the machine we will go back to the installation part. Therefore, when you are asked whether install or use live CD, choose live CD. Then you will be brought to Live CD version of Haiku. From this state, turn off Haiku. You can click thing on top-right of desktop and choose shutdown.

Now, whenever you want to boot Haiku, use following command:

qemu-system-i386 -m 256 -hda haiku.img -localtime -serial file:haiku.log

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

And here we have, Haiku.

qemu_haiku10

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 🙂

Social media & sharing icons powered by UltimatelySocial