Run a copy of your AA1 in VirtualBox

Intro

This article is about how to get your AA1 image running in VirtualBox. This is useful, when you need to support a Acer AA1, but cannot have your own. These notes here are a brain dump after the implementation and might be wrong or incomplete. You’ve been warned.

Making the copy

For making the copy there aren’t many alternatives. One of them if booting Knoppix. Knoppix can be configured to automatically provide something called a Knoppix Terminal-Server. It allows you to netboot other machines into Knoppix. It is important that you do not deactivate root access on the terminal machines. 

 

Once the Knoppix Terminal Server is up, Knoppix can be booted on the AA1 as well. Select F12 in the early bootup screen and there choose network booting. Once you have Knoppix running on your AA1 you basically got an alternative OS and can work on the AA1’s native OS from the side.
Essentially you want to copy the hard drive image to a different location. I had used the tool rsync to mirror the image to a space on an SSH server. That can be accomplished by doing these steps:
  1. Mount the hard drive through GUI or by doing mount /media/sda1
  2. Open a root shell and run the command: rsync -az /media/sda1 remote.server:/space/ or create a tar archive with: cd /media/sda1; tar c | ssh remote.server “cat – > sda1.tar”
  3. Make a note of the partitioning scheme: parted /dev/sda print > /media/sda1/part.txt
  4. Unmount /media/sda1
Now /space/sda1 or sda1.tar – depending on which method you chose – on the machine remote.server contains an exact replica of your root file system. When the copying finished, you can shut down the Knoppix’.

Restoring the copy in VirtualBox 

Restoring could be done similarly than making the copy.

 

  1. You create a new virtual machine and assign it 8GB hard disk drive. 
  2. You assign a Knoppix CD as a CD-ROM image and boot into the new machine
  3. You partition the hard drive according to the specs previously saved in part.txt, create the filesystems with mke2fs and mount them in their right places
  4. You restore the backup either by: rsync -az remote.server:/space/sda1/ /media/sda1/ or by cd /media/sda1; ssh remote.server cat sda1.tar | tar x

 

Adjusting the copy for booting in VirtualBox

Before you can use the copy, a few minor adjustments are necessary.
First, the kernel did not recognize the hard drive. I tricked myself around with two modifications:
  • Compiling a new kernel with the IDE driver build in
  • Adjusting the kernel parameters to point the kernel directly to the root partition
To get started on compiling a new kernel for your AA1, you first have to download it. Kernels can be downloaded from www.kernel.org and the version you’re looking for is 2.6.23.9. Before building the kernel you should grab the kernel configuration file from /boot on your AA1 and put it into the root of your untarred kernel tree under the filename .config. If you make oldconfig now the kernel is ready to build. Now it’s time for a few adjustments. Activate the following options with Y, not M:
  • the IDE/ATAPI driver
  • PIIX4 PCI driver
  • the AHCI driver, if not already activated
The config file I ended up with (after activating some other drivers as well that are not documented here) is attached to this article as .config. You can build the kernel with make. arch/i386/boot/bzImage will contain your kernel. Copy it into /boot/ under a different name, for example bzImage-IDE. Modules need not to be copied as the essential changes are linked into the monolithic part of the kernel.

Now edit /boot/grub/grub.conf and point it to bzImage-IDE instead of bzImage. Also append root=/dev/sda1 to the kernel command line and comment the line mentioning the initrd file. Now in theory your system should be bootable. A sample grub.conf is attached to this article.

But you won’t see anything yet, because the Xorg driver needs to be reconfigured. The Xorg configuration file is /etc/X11/xorg.conf. The section for Monitor0 is best replaced with the same section from /etc/X11/xorg.conf as it was detected by the Knoppix running in that virtual machine. That gives you a generic configuration for your monitor. In the Videocard0 section, the driver has to be changed from “intel” to “vesa”. In “Screen0” we change the first default video mode from 1024×600 to 1024×768. A xorg.conf is attached to this article, but instead of replacing the sections they have been renamed.

Leave a Reply

Your email address will not be published. Required fields are marked *