Debian Under Qemu

From Dmz-portal

Jump to: navigation, search

Contents

Overview

This page describes installation and booting 32/64-bit Debian Linux under Qemu emulation.

Mipsel 32-bit

Download initrd.gz and vmlinux-2.6.32-5-4kc-malta. You can use any Debian mirrors. For example this one

Create disk image file. This command creates 10Gb sparse file.

% qemu-img create -f qcow hda.img 10G

Run installer. Go through the installation wizard.

% qemu-system-mipsel -M malta \
   -kernel vmlinux-2.6.32-5-4kc-malta -initrd initrd.gz \
   -hda hda.img -append "console=ttyS0" -nographic -no-reboot

Boot installed Debian Linux. Now you can remove initrd.gz from your host machine.

% qemu-system-mipsel -M malta -kernel vmlinux-2.6.32-5-4kc-malta \
   -hda hda.img \
   -append "root=/dev/sda1 console=ttyS0" -nographic \
   -m 256 -no-reboot

For development you need to install libc6-dev package

% apt-get install libc6-dev

Mipsel 64-bit

Download initrd.gz and vmlinux-2.6.32-5-4kc-malta. You can use any Debian mirrors. For example this one

Create disk image file. This command creates 10Gb sparse file.

% qemu-img create -f qcow hda.img 10G

Run installer. Go through the installation wizard.

% qemu-system-mips64el -M malta \
   -kernel vmlinux-2.6.32-5-4kc-malta -initrd initrd.gz \
   -hda hda.img -append "console=ttyS0" -nographic -no-reboot

Boot the system using vmlinux-2.6.32-5-4kc-malta kernel

% qemu-system-mips64el -M malta -cpu 5Kc \
   -kernel vmlinux-2.6.32-5-4kc-malta -hda hda.img \
   -append "root=/dev/sda1 console=ttyS0" -nographic -no-reboot

Copy vmlinux-2.6.32-5-5kc-malta kernel to your host machine

% scp /boot/vmlinux-2.6.32-5-5kc-malta <user>@10.0.2.2:/home/<user>/...

Boot the system using vmlinux-2.6.32-5-5kc-malta kernel

% qemu-system-mips64el -M malta -cpu 5Kc \
   -kernel vmlinux-2.6.32-5-5kc-malta -hda hda.img \
   -append "root=/dev/sda1 console=ttyS0" -nographic -no-reboot

For development you need to install libc6-dev-mips64 package

% apt-get install libc6-dev-mips64

File Transfer

To transfer files between host and virtual machine you can use scp command:

% scp file_on_vm john@10.0.2.2:/home/john   # copy file_on_vm from vm to the host machine to the home folder of john
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox