Difference between revisions of "Pidora 2014 qemu"
(→Getting QEMU) |
(Fix Pidora and QEMU formatting) |
||
Line 12: | Line 12: | ||
== Pidora QEMU Compose == | == Pidora QEMU Compose == | ||
− | Using | + | Using Pidora in a QEMU environment has some important restrictions to note. The model that is used to emulate Pidora has a hard coded restriction on how much ram it can use(256mb). The programs we use(livemedia-creator) for composing new images require much more ram, which makes the Pidora QEMU Environment a bad place to try and create images. (See compose on Fedora Arm QEMU) |
= Pidora QEMU Setup = | = Pidora QEMU Setup = | ||
− | The two stages to setting up Pidora | + | The two stages to setting up Pidora QEMU involve, getting all the files(kernel, image) and installing the QEMU environment. |
== Getting The Files == | == Getting The Files == | ||
<pre> | <pre> | ||
− | # Choose the directory to put both the image and the compiled | + | # Choose the directory to put both the image and the compiled QEMU software |
pidora_dir=/data/pidora-qemu | pidora_dir=/data/pidora-qemu | ||
Line 27: | Line 27: | ||
cd ${pidora_dir} | cd ${pidora_dir} | ||
− | # Download the | + | # Download the QEMU kernel |
wget http://xecdesign.com/downloads/linux-qemu/kernel-qemu | wget http://xecdesign.com/downloads/linux-qemu/kernel-qemu | ||
− | # Download the | + | # Download the Pidora image |
wget http://pidora.ca/pidora/releases/20/images/Pidora-2014-R1.zip | wget http://pidora.ca/pidora/releases/20/images/Pidora-2014-R1.zip | ||
Line 40: | Line 40: | ||
== Getting QEMU == | == Getting QEMU == | ||
− | There are multiple ways to get qemu-system-arm. You can compile a new version with a few select flags, or you can try installing the version that your distribution has already compiled. It is possible that the | + | There are multiple ways to get qemu-system-arm. You can compile a new version with a few select flags, or you can try installing the version that your distribution has already compiled. It is possible that the QEMU packaged in your distro was not compiled with the proper flags, however it seems to work on the latest fedora 20. |
=== Package Install === | === Package Install === | ||
Line 50: | Line 50: | ||
=== Manual Compile === | === Manual Compile === | ||
− | If the above package does not allow you to boot Pidora through | + | If the above package does not allow you to boot Pidora through QEMU, you can try the manual instructions below. This will allow you to use the QEMU software without actually installing it on your system(I don't like installing source files that are not managed by yum). |
The manual compile will require the dependencies for the program to already be installed. Below is a list of packages that might be required(I think only the devel ones are needed?). | The manual compile will require the dependencies for the program to already be installed. Below is a list of packages that might be required(I think only the devel ones are needed?). | ||
Line 61: | Line 61: | ||
<pre> | <pre> | ||
− | # Choose the directory for the compiled | + | # Choose the directory for the compiled QEMU software |
pidora_dir=/data/pidora-qemu | pidora_dir=/data/pidora-qemu | ||
− | # Make a new directory for | + | # Make a new directory for QEMU and enter it |
mkdir ${pidora_dir}/raspidev/ | mkdir ${pidora_dir}/raspidev/ | ||
cd ${pidora_dir/raspidev/ | cd ${pidora_dir/raspidev/ | ||
Line 80: | Line 80: | ||
</pre> | </pre> | ||
− | = Boot Pidora in | + | = Boot Pidora in QEMU = |
Make sure you run the steps in "Before Booting" and "The First Boot" before you start Pidora for the first time to avoid issues. | Make sure you run the steps in "Before Booting" and "The First Boot" before you start Pidora for the first time to avoid issues. | ||
== Before Booting == | == Before Booting == | ||
{{Admon/important| Warning! | Running the command "dd" can be dangerous and could result in data loss if not used properly.}} | {{Admon/important| Warning! | Running the command "dd" can be dangerous and could result in data loss if not used properly.}} | ||
− | Make sure that you add some more space to the image file. Depending on what you want to do with the | + | Make sure that you add some more space to the image file. Depending on what you want to do with the Pidora image you may want more space. Replace the value in the variable size, with the number of GB to increase the size of the image with. |
<pre> | <pre> | ||
− | # Choose the directory for the compiled | + | # Choose the directory for the compiled QEMU software |
pidora_dir=/data/pidora-qemu | pidora_dir=/data/pidora-qemu | ||
Line 98: | Line 98: | ||
== The First Boot == | == The First Boot == | ||
− | At this step we need to boot | + | At this step we need to boot Pidora, start first boot, and allow it to automatically resize the partition inside the image to the right size. This will only work if you already increase the size of the image in the previous steps. |
<pre> | <pre> | ||
− | # Choose the directory for the compiled | + | # Choose the directory for the compiled QEMU software |
pidora_dir=/data/pidora-qemu | pidora_dir=/data/pidora-qemu | ||
− | # This is the command to boot the Pidora Image using the compiled version of | + | # This is the command to boot the Pidora Image using the compiled version of QEMU |
${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm -kernel ${pidora_dir}/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda ${pidora_dir}/Pidora-2014-R1.img | ${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm -kernel ${pidora_dir}/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda ${pidora_dir}/Pidora-2014-R1.img | ||
</pre> | </pre> | ||
Line 111: | Line 111: | ||
<pre> | <pre> | ||
− | # Choose the directory for the compiled | + | # Choose the directory for the compiled QEMU software |
pidora_dir=/data/pidora-qemu | pidora_dir=/data/pidora-qemu | ||
− | # This is the command to boot the Pidora Image using the compiled version of | + | # This is the command to boot the Pidora Image using the compiled version of QEMU |
${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm -kernel ${pidora_dir}/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda ${pidora_dir}/Pidora-2014-R1.img | ${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm -kernel ${pidora_dir}/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda ${pidora_dir}/Pidora-2014-R1.img | ||
</pre> | </pre> | ||
Line 121: | Line 121: | ||
<pre> | <pre> | ||
− | # Choose the directory for the compiled | + | # Choose the directory for the compiled QEMU software |
pidora_dir=/data/pidora-qemu | pidora_dir=/data/pidora-qemu | ||
− | # This is the command to boot the Pidora Image using the compiled version of | + | # This is the command to boot the Pidora Image using the compiled version of QEMU |
${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm -kernel ${pidora_dir}/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw 3" -hda ${pidora_dir}/Pidora-2014-R1.img | ${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm -kernel ${pidora_dir}/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw 3" -hda ${pidora_dir}/Pidora-2014-R1.img | ||
</pre> | </pre> | ||
Line 135: | Line 135: | ||
If for some reason the Pidora Partitions did not resize after running first boot and you did run the dd command above to increase the size of the image, then we will manually resize the file system here. | If for some reason the Pidora Partitions did not resize after running first boot and you did run the dd command above to increase the size of the image, then we will manually resize the file system here. | ||
− | First start up Pidora | + | First start up Pidora QEMU in Multi-user: |
<pre> | <pre> | ||
− | # Choose the directory for the compiled | + | # Choose the directory for the compiled QEMU software |
pidora_dir=/data/pidora-qemu | pidora_dir=/data/pidora-qemu | ||
− | # This is the command to boot the Pidora Image using the compiled version of | + | # This is the command to boot the Pidora Image using the compiled version of QEMU |
${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm -kernel ${pidora_dir}/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw 3" -hda ${pidora_dir}/Pidora-2014-R1.img | ${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm -kernel ${pidora_dir}/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw 3" -hda ${pidora_dir}/Pidora-2014-R1.img | ||
</pre> | </pre> | ||
− | Log in to root on | + | Log in to root on Pidora, the default root password should be "raspberrypi" if it was not changed. Make sure you are running the next commands on the QEMU Pidora environment. |
<pre> | <pre> | ||
Line 173: | Line 173: | ||
</pre> | </pre> | ||
− | Now the Pidora | + | Now the Pidora QEMU environment has been successfully extended to the max size of the image file. |
Revision as of 12:23, 28 May 2014
Contents
Pidora QEMU
This page is here to assist people who would like to run Pidora 2014 in a QEMU environment. This tutorial has been adapted from this website: http://xecdesign.com/compiling-qemu/
Pidora QEMU Compose
Using Pidora in a QEMU environment has some important restrictions to note. The model that is used to emulate Pidora has a hard coded restriction on how much ram it can use(256mb). The programs we use(livemedia-creator) for composing new images require much more ram, which makes the Pidora QEMU Environment a bad place to try and create images. (See compose on Fedora Arm QEMU)
Pidora QEMU Setup
The two stages to setting up Pidora QEMU involve, getting all the files(kernel, image) and installing the QEMU environment.
Getting The Files
# Choose the directory to put both the image and the compiled QEMU software pidora_dir=/data/pidora-qemu # Make the directory and enter it mkdir ${pidora_dir} cd ${pidora_dir} # Download the QEMU kernel wget http://xecdesign.com/downloads/linux-qemu/kernel-qemu # Download the Pidora image wget http://pidora.ca/pidora/releases/20/images/Pidora-2014-R1.zip # Unzip the image file unzip Pidora-2014-R1.zip
Getting QEMU
There are multiple ways to get qemu-system-arm. You can compile a new version with a few select flags, or you can try installing the version that your distribution has already compiled. It is possible that the QEMU packaged in your distro was not compiled with the proper flags, however it seems to work on the latest fedora 20.
Package Install
This method should probably be good enough to run Pidora in Qemu. I have only tested on Fedora 20, and it works.
yum install qemu-system-arm
Manual Compile
If the above package does not allow you to boot Pidora through QEMU, you can try the manual instructions below. This will allow you to use the QEMU software without actually installing it on your system(I don't like installing source files that are not managed by yum).
The manual compile will require the dependencies for the program to already be installed. Below is a list of packages that might be required(I think only the devel ones are needed?).
# Install Dependencies(not sure if the non-devel packages are required?) yum install gcc-++ zlib zlib-devel SDL SDL-devel pixman pixman-devel libfdt-devel libtool glib2 glib2-devel
Compile qemu-system-arm:
# Choose the directory for the compiled QEMU software pidora_dir=/data/pidora-qemu # Make a new directory for QEMU and enter it mkdir ${pidora_dir}/raspidev/ cd ${pidora_dir/raspidev/ git clone git://git.qemu-project.org/qemu.git cd ${pidora_dir}/raspidev/qemu/ # Configure the options for raspberry pi ./configure --target-list="arm-softmmu arm-linux-user" --enable-sdl --prefix=/usr # Finally, compile it make
Boot Pidora in QEMU
Make sure you run the steps in "Before Booting" and "The First Boot" before you start Pidora for the first time to avoid issues.
Before Booting
Make sure that you add some more space to the image file. Depending on what you want to do with the Pidora image you may want more space. Replace the value in the variable size, with the number of GB to increase the size of the image with.
# Choose the directory for the compiled QEMU software pidora_dir=/data/pidora-qemu # Size = GB size=4 dd if=/dev/zero bs=1G count=${size} >> ${pidora_dir}/Pidora-2014-R1.img
The First Boot
At this step we need to boot Pidora, start first boot, and allow it to automatically resize the partition inside the image to the right size. This will only work if you already increase the size of the image in the previous steps.
# Choose the directory for the compiled QEMU software pidora_dir=/data/pidora-qemu # This is the command to boot the Pidora Image using the compiled version of QEMU ${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm -kernel ${pidora_dir}/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda ${pidora_dir}/Pidora-2014-R1.img
Pidora Graphical Boot
# Choose the directory for the compiled QEMU software pidora_dir=/data/pidora-qemu # This is the command to boot the Pidora Image using the compiled version of QEMU ${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm -kernel ${pidora_dir}/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda ${pidora_dir}/Pidora-2014-R1.img
Pidora Multi-user Boot
# Choose the directory for the compiled QEMU software pidora_dir=/data/pidora-qemu # This is the command to boot the Pidora Image using the compiled version of QEMU ${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm -kernel ${pidora_dir}/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw 3" -hda ${pidora_dir}/Pidora-2014-R1.img
Issues
Some issues can occur during the above processes. Some fixes are listed below.
Manually Resize Pidora
If for some reason the Pidora Partitions did not resize after running first boot and you did run the dd command above to increase the size of the image, then we will manually resize the file system here.
First start up Pidora QEMU in Multi-user:
# Choose the directory for the compiled QEMU software pidora_dir=/data/pidora-qemu # This is the command to boot the Pidora Image using the compiled version of QEMU ${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm -kernel ${pidora_dir}/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw 3" -hda ${pidora_dir}/Pidora-2014-R1.img
Log in to root on Pidora, the default root password should be "raspberrypi" if it was not changed. Make sure you are running the next commands on the QEMU Pidora environment.
# start fdisk program fdisk /dev/sda # list all partitions, note the start location of partition 2 p # delete a partition d # select partition 2 2 # create a new partition n # select partition 2 2 # select start location, default should be the start location from above <press enter for default> # select end location <press enter for default> # write/save the changes w reboot <pre> After the Pidora restarts, run the following command to finish the resize setup: <pre> resize2fs /dev/sda2
Now the Pidora QEMU environment has been successfully extended to the max size of the image file.