Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've come quite close to getting Amazon Linux to boot inside VirtualBox, thanks to this answer and these websites. A quick overview of the steps I've taken:

  1. Launch EC2 instance with Amazon Linux 2011.09 64-bit AMI
  2. dd the contents of the EBS volume over ssh to a local image file.
  3. Mount the image file as a loopback device and then to a local mount point.
  4. Create a new empty disk image file, partition with an offset for a bootloader, and create an ext4 filesystem.
  5. Mount the new image's partition and copy everything from the EC2 image.
  6. Install grub (using Ubuntu's grub-legacy-ec2 package, not grub2).
  7. Convert the image file to vmdk using qemu-img.
  8. Create a new VirtualBox VM with the vmdk.

Now the VM boots, grub loads, and the kernel is found. But it fails when it tries to mount the root device:

dracut Warning: No root device "block:/dev/xvda1" found

dracut Warning: Boot has failed. To debug this issue add "rdshell" to the kernel command line.


dracut Warning: Signal caught!

dracut Warning: Boot has failed. To debug this issue add "rdshell" to the kernel command line.
Kernel panic - not syncing: Attempted to kill init!
Pid: 1, comm: init Not tainted 2.6.35.14-107.1.39.amzn1.x86_64 #1

I have tried changing /boot/grub/menu.lst to find the root device by label and UUID, but nothing works. I'm guessing the xen kernel is not compatible with VirtualBox.

The reasoning behind all this effort is to make a Vagrant box that is as close to possible as the production enviroment, so deploys can be tested locally. I know it's cheap to do test runs on EC2, but poor connectivity often ruins the experience. Plus it would be really nice to have a virtual machine with the production environment so that co-workers don't have to install everything under the sun just to get up and running with app development.

If I were to try running a different kernel, what kernel could I get to be as close as possible to Amazon Linux 2011.09?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

I tried so much and I was giving up, but at the end I succeed!

I've managed to boot with an Amazon Linux AMI ported under vmware!

I'm almost a newby, but I did it, after hours of trials, substituting the original amazon kernel with a vmlinuz-2.6.32-38-generic taken from an ubuntu 64 10.04 distro.

I just get a lot of errors because the amazon configuration inside the AMI is looking for something in an internal address that obviously it doesn't find. It's the /usr/bin/cloud-init, I think.

But I can login inside, and it seems that everything is working!

Thanks for your help!!

I've written this blogpost with step by step instructions to migrate from AMI to Vmware.

Hope this helps!

share|improve this answer
    
BTW, Reed, I arrived exactly at the point you stated (dracut telling "no root device found"... did you move any further?? –  Emanuele Preda Aug 30 '12 at 19:27
    
I came to basically the same solution you did: copying the kernel from Ubuntu. It works, but at that point I don't know how similar the system will perform to the Amazon Linux AMI. –  Reed G. Law Sep 4 '12 at 4:32
add comment

The official kernel Amazon derived theirs in their 2011.09 distribution, ie 2.6.35.14.

You can probably get the source package for the Amazon one with get_reference_source, but I wouldn't expect it to work outside of Amazon anyway.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.