Instructions to Run Raspberry Pi Fedora 14 Remix in QEMU

As mentioned in my previous post, the Raspberry Pi Foundation has just released the Fedora 14 Remix SD card image that can be installed either via  installer (easiest method) or using dd / windd as with the previous image.

In this blog post, I’ll give the instructions how to run Raspberry Pi Fedora 14 Remix in QEMU using a similar method than the one I used for Debian Squeeze. I tested since in machines with Ubuntu 10.04 LTS and Debian 6.0.4.

  1. Download the image using BitTorrent raspberrypi-fedora-remix-14-r1.img.gz.torrent or via the HTTP link available on Raspberry Pi Download page.
  2. Decompress the image:
  3. Download kernel 3.0.4 image for qemu, if you don’t have it yet.
  4. Since the rootfs is full (in the real board it will be resized to the size of the SD Card), we need to increase the size of the rootfs partition. First create and empty 3G image and format it to ext3:
  5. Find the offset for the rootfs in the SD card image, mount it and copy the files to the new image:

    #file raspberrypi-fedora-remix-14-r1.img
    raspberrypi-fedora-remix-14-r1.img: x86 boot sector; partition 1: ID=0xb, active, starthead 0, startsector 2048, 204800 sectors; partition 2: ID=0x83, starthead 0, startsector 206848, 3246080 sectors, code offset 0xb8
    mkdir mnt
    mkdir mnt2
    sudo mount -o loop,offset=$[206848*512] raspberrypi-fedora-remix-14-r1.img mnt
    sudo mount -o loop rootfs3G.ext3 mnt2
    sudo cp mnt/* mnt2 -a
    sudo umount mnt2
    sudo umount mnt

  6. Build the latest qemu-linaro (Optional) . This fixes the “qemu-system-arm: slirp/arp_table.c:41 ” error for me  (Cf Note 1 at the bottom of this post). Following the instructions at http://www.cnx-software.com/2012/03/08/how-to-build-qemu-system-arm-in-linux/:
  7. Run QEMU as follows:

    qemu-system-arm -M versatilepb -cpu arm1176 -m 192 -hda rootfs3G.ext3 -kernel zImage -append "root=/dev/sda" -serial stdio -redir tcp:2222::22

    There is no password as the first time the image runs, it will ask you to set the root password, create a regular user and set a password for that user, select your timezone, and select whether you wish to boot into graphical or text mode.  The very first time, it will stay in terminal mode even if you selected Graphical mode.  Login as root to access the command line and change the permissions of the temp directory:


    You can now either  reboot your emulator or type “init 5” to start the graphical interface.

    If for some reasons you have no access to the keyboard in the graphical interface, you can always login to qemu via ssh to access the command line:

Once you followed those steps and selected graphical mode, you should see a login screen that looks like the one below.

Raspberry Pi QEMU
Raspberry Pi Fedora 14 Remix in QEMU

Note 1: If you get the following error:

qemu-system-arm: slirp/arp_table.c:41: arp_table_add: Assertion `(ip_addr & (__extension__ ({ register unsigned int __v, __x = (~(0xf << 28)); if (__builtin_constant_p (__x)) __v = ((((__x) & 0xff000000) >> 24) | (((__x) & 0x00ff0000) >> 8) | (((__x) & 0x0000ff00) << 8) | (((__x) & 0x000000ff) << 24)); else __asm__ (“bswap %0” : “=r” (__v) : “0” (__x)); __v; }))) != 0′ failed.
Aborted

You can either add “-net none” to make it “work”, but you won’t have network access or try step 6 in the instructions above.

60
Leave a Reply

avatar
59 Comment threads
1 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
13 Comment authors
BobJohnEmulation: Raspberry Pi Fedora 14 Remix under QEMUbob_binzTexy Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
trackback

[…] (TBD)Architecture: armv5telUpdate: If you want to run this release in qemu, I’ve posted the Instructions to Run Raspberry Pi Fedora 14 Remix in QEMU in a separate post. (function(){var […]

Sander
Guest
Sander

Thank you for your post. A few remarks:

– needless to say, but you need to gunzip the img.gz
– md5sum is: 53d13c194ad37f7f59586ff10313b178 raspberrypi-fedora-remix-14-r1.img
– I need the “-net none” too ๐Ÿ™ (Ubuntu 11.10 64-bit)
– On the first login, you need to change your password, which was annoying: it kept saying the password was in a dictionary (even with a 4 letters + 3 numbers). Solution: 8 ‘random’ letters
– on the first boot, indeed no GUI
– on second boot, I get the login GUI (in brown, not blue), and I can select my name, but the password field is not accepting any keyboard input: the vertical line in that field is blinking, but nothing happens when typing on the keyboard and/or pressing ENTER. So I can’t login. ๐Ÿ™

Sander
Guest
Sander

Some more results:

– the forced password change on first login is horrible. And it keeps on saying “dictionary”. It’s very picky. I fear this will be a dissatisfier for Raspi users. I wonder why the Seneca/Raspi have chosen this high level of security.
– On the first (so: non-GUI) run, after I login on the CLI and I issue “date > blabla.txt” it says “no space left on device”. And “df” shows 0 bytes free. There are two devices: /dev/mmcblk0p1 and tmpfs. Is that correct?

Sander
Guest
Sander

Thanks to your new instructions, I was able to get it running.

Typos IMHO:

dd if=/dev/zero of=rootfs3G count=6M
dd if=/dev/zero of=rootfs3G.ext3 count=6M
(so: .ext3 as extension)

sudo mount -o loop ,offset=$[206848*512] raspberrypi-fedora-remix-14-r1.img mnt
sudo mount -o loop,offset=$[206848*512] raspberrypi-fedora-remix-14-r1.img mnt
(so: no space)

sudo mount -o loop rootfs3G.ext3 mnt3
sudo mount -o loop rootfs3G.ext3 mnt2
(s0: mnt2, not mnt3)

Remarks:

The “ssh … / chmod 777 /tmp” was indeed necessary, so better to include it in the instruction itself?
I didn’t want/dare to “make install” (BTW: isn’t sudo needed) the new qemu, so I’m running it from the subdirectory it was made in: ” qemu-linaro/arm-softmmu/qemu-system-arm …” and that works.

Result: a working GUI. Great. Thank you for your work and instructions!

Now I have to find the Fedora commands (after 6 years Ubuntu) …

Sander
Guest
Sander

BTW: the “ssh -p 2222 [email protected]” is fantastic! That way the emulated-arm only needs to run a prompt (and no Firefox, which seems to be very heavy), and I can just copy-paste command from Chromium on the host into the ssh terminal of the emulated ARM. Works much better.

skyspy
Guest
skyspy

Hi,

I followed your instructions until step 7 without an error. But when i try to start qemu with the command:

qemu-system-arm -M versatilepb -cpu arm1176 -m 192 -hda rootfs3G.ext3 -kernel zImage -append “root=/dev/sda” -serial stdio -redir tcp:2222::22

The following happens:

oss: Could not initialize DAC
oss: Failed to open /dev/dsp'
oss: Reason: No such file or directory
oss: Could not initialize DAC
oss: Failed to open
/dev/dsp’
oss: Reason: No such file or directory
audio: Failed to create voice lm4549.out'
VNC server running on
127.0.0.1:5900′
Uncompressing Linux… done, booting the kernel.

After this output nothing more happens.

I hope you can help me with this problem.
I am working on a Fedora 16 with version 1.0.50 of qemu

Thanks for your great how-to,

Sander
Guest
Sander

@skyspy:

You need to open a VNC connection to 127.0.0.1:5900

On Ubuntu: vinagre localhost:5900

HTH

Sander
Guest
Sander

Ouch: no IPv6 in the Fedora-ARM-image … ?

[[email protected] ~]# service miredo-client start
Starting miredo: Error: IPv6 stack not available.
[FAILED]
[[email protected] ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 52:54:00:12:34:56
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:73657 errors:0 dropped:0 overruns:0 frame:0
TX packets:31052 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:91319418 (87.0 MiB) TX bytes:2823309 (2.6 MiB)
Interrupt:25 DMA chan:ff

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1547 errors:0 dropped:0 overruns:0 frame:0
TX packets:1547 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:162859 (159.0 KiB) TX bytes:162859 (159.0 KiB)

[[email protected] ~]#

skyspy
Guest
skyspy

@Sander

Thanks using tigervnc on Fedora works!

I think the errors concerning the audio hardware are based on the fact that I run my Fedora in a virtual machine.

qemu-system-arm -version sais: QEMU emulator version 1.0.50 (qemu-linaro from git), Copyright (c) 2003-2008 Fabrice Bellard

Sander
Guest
Sander

I have a problem with the XScreenSaver 5.12 that is locking the screen after a while: after typing my password, it says “authentication failed”. It is the password I used to logon. I still can logon using ssh.

Strange.

I will reboot, get into the GUI and then try to disable the screen saver / screen locker.

Sander
Guest
Sander

I have the same messages:

oss: Could not initialize DAC
oss: Failed to open /dev/dsp'
oss: Reason: No such file or directory
oss: Could not initialize DAC
oss: Failed to open
/dev/dsp’
oss: Reason: No such file or directory
audio: Failed to create voice lm4549.out'
VNC server running on
127.0.0.1:5900′

Jan H Jensen
Guest
Jan H Jensen

Thanks for the instructions. Worked beautifully for me ๐Ÿ™‚ !

I tried first with a stock QEMU but ran into the documented slirp assertion. Following step 6 resolved it and now everything works fine. Rather slow (a BogoMIPS of 183 on my system – not exactly a speed daemon ;-)), but it works.

Sander, I get the same messages on startup but the VM starts up just fine. Run “vncviewer localhost” and you should be able to see the VM boot.

Brian
Guest
Brian

Working great here also.
I don’t suppose you have the built 3.0.4 kernel modules also? Would be useful for things like ext3 support etc.

Sander
Guest
Sander

@cnxsoft

Could you create and provide a kernel with IPv6? I tried the instruction, but that’s above my head: I got stuck at “General Setup โ€”>Cross-compiler tool prefix (We need to enter the path of the toolchain followed by โ€˜/bin/arm-none-eabi-โ€™)” … toolchain?

alanyih
Guest
alanyih

@ cnxsoft

Typos IMHO:

chmod haldaemon:haldaemon /var/cache/hald -R.
chown haldaemon:haldaemon /var/cache/hald -R.

Thank you for your howto!

Rod
Guest
Rod

I have similar issue with the screensaver, except I can type but the password is not accepted. The second digit is an @ so I tried both [shift] [2] and [shift] the key next to [L].
Still looking.

Sander
Guest
Sander

@cnxsoft Thank you for the IPv6-enabled kernel. With IPv6 I will be able to access the emulated ARM directly on all ports, as IPv6 is not bother by Qemu’s NAT

@rod: Even my quite normal password (letters + numbers)doesn’t work. I think there is something wrong with the screensaver.
As I couldn’t find yet where to disable the screensaver, I’ve just kill-ed the it: ps -ef | grep -i xscreen, and then kill it. Maybe “kill xscreensaver” also works.

Sander
Guest
Sander

FYI:

As root, I removed the screensaver like this:

yum remove xscreensaver-base.armv5tel

No screensaver, so no screensaver login problem, I hope.

Sander
Guest
Sander

I now have a Qemu resolution of 640×480. I tried starting with “-vga cirrus” and “-vga std”, but I got “Error: Cirrus VGA not available”

Does anybody else know a method to get a higher resolution than 640×480?

Jason
Guest
Jason

Hi Guys,

Following the instructions I got the image to boot and (after setup and restart) to get to the login GUI. But after choosing the user and putting in the password, it loops back to the login screen. Has anyone else had this problem? I tried it both on my Mac and in a linux VM running in virtualbox, with the same results.

Thanks,

Jason

Jason
Guest
Jason

Thanks cnxsoft – that did the trick. I get the desktop and I was able to check with firefox and network is OK, also.

Jason

Morgaine
Guest
Morgaine

Perfect HOWTO: worked exactly as described, even as far as the error message and the fix for it by compiling up a new qemu-system-arm obtained from Linaro’s Git repo. And I’m not even on Ubuntu. ๐Ÿ˜› (Gentoo x86)

That Fedora password enforcement is the work of a pure sadist, btw. If I have to reset my password one more time to something that it thinks is suitable, I’ll scream. Anyone know where that is configured? There’s no need for such overkill security in this image which I only use for testing in a closed environment.

Sander
Guest
Sander

@cnxsoft

Thank you for the ipv6-enabled kernel. It indeed shows fe80::… in the ifconfig, so that’s gooed. I tried to install miredo-client to get IPv6 connectivity to the outside world, which … needs the TUNTAP driver. ๐Ÿ™

[[email protected] ~]# service miredo-client start
Starting miredo: Error: your operating system does not seem to provide a network tunneling
device driver, which is required.
Make sure your Linux kernel includes the “Universal TUNTAP driver”
(CONFIG_TUN option), possibly as a module.
[FAILED]

So … can you include TUNTAP too, or is it time for me to setup a “toolchain” … ?

Sander
Guest
Sander

BTW:

my raspi-image seems to have a different startsector. I used your number anyway, and that works … good or bad?

$ file raspberrypi-fedora-remix-14-r1.img

raspberrypi-fedora-remix-14-r1.img: x86 boot sector; partition 1: ID=0xb, active, starthead 0, startsector 2048, 204800 sectors; partition 2: ID=0x83, starthead 0, startsector 206848, 3246080 sectors, code offset 0xb8

Sander
Guest
Sander

PS: is my md5sum the same as yours?

$ md5sum raspberrypi-fedora-remix-14-r1.img
039673ad14ebe98f36697e461cabeb7c raspberrypi-fedora-remix-14-r1.img

Sander
Guest
Sander

@cnxsoft

OK, I tried … I can’t find “PCI Support”. So, to speed things up: could post or mail me your “.config”? After changing “CONFIG_CROSS_COMPILE” to mine, and putting in TUNTAP, I should be able to compile it … ๐Ÿ™‚

Texy
Guest
Texy

@ Jason

I have this problem also, but how do I get to the command line if the system goes straight to GUI login?
I tried to create the image again and chose No to go straight to GUI when first setting up the system, but I cannot use ‘su’ command – it insists I have entered the password incorrectly, even though I am sure I have entered it as I set it up! therefore I cannot use the command
chmod 777 /tmp

Any idea’s ??
Texy

Texy
Guest
Texy

OK,to answer my own question, you need to ssh in another session with
ssh -p 2222 [email protected]

Now my problem is how to increase the screen rez from 640 x 480

T.