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.

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK Pi 4C Plus
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
58 Comments
oldest
newest
Sander
Sander
12 years ago

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… Read more »

Sander
Sander
12 years ago

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?

cnxsoft
12 years ago

@ Sander
Sorry, I’ve noticed keyboard input did not work after this post. I’ll try to make this work a bit later.

cnxsoft
12 years ago

@ Sander
I also get 2 devices with tmpfs and /dev/mmcblk0p1 which are full. I think the reason for it is that this release of Fedora tries to resize the rootfs to the size of the SD card during the first boot. We don’t have SD card so no resizing takes place.

cnxsoft
12 years ago

@ Sander
About “On the first login (and actually others), you need to change your password.”. This is most probably because the network is not working and we can’t get the time with NTP.

cnxsoft
12 years ago

@ Sander
For the network bug, try to build qemu (using linaro development tree – 3rd option) as explained in http://www.cnx-software.com/2012/03/08/how-to-build-qemu-system-arm-in-linux/. It fixes the issue for me.

Sander
Sander
12 years ago

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… Read more »

Sander
Sander
12 years ago

BTW: the “ssh -p 2222 root@localhost” 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
skyspy
12 years ago

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… Read more »

Sander
Sander
12 years ago

@skyspy:

You need to open a VNC connection to 127.0.0.1:5900

On Ubuntu: vinagre localhost:5900

HTH

Sander
Sander
12 years ago

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

[root@raspi ~]# service miredo-client start
Starting miredo: Error: IPv6 stack not available.
[FAILED]
[root@raspi ~]# 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)

[root@raspi ~]#

skyspy
skyspy
12 years ago

@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
Sander
12 years ago

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
Sander
12 years ago

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
Jan H Jensen
12 years ago

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
Brian
12 years ago

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
Sander
12 years ago

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
alanyih
12 years ago

@ cnxsoft

Typos IMHO:

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

Thank you for your howto!

Rod
Rod
12 years ago

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
Sander
12 years ago

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
Sander
12 years ago

FYI:

As root, I removed the screensaver like this:

yum remove xscreensaver-base.armv5tel

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

Sander
Sander
12 years ago

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
Jason
12 years ago

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
Jason
12 years ago

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
Morgaine
12 years ago

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
Sander
12 years ago

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. 🙁

[root@raspi ~]# 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
Sander
12 years ago

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
Sander
12 years ago

PS: is my md5sum the same as yours?

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

Sander
Sander
12 years ago

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
Texy
12 years ago

@ 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
Texy
12 years ago

OK,to answer my own question, you need to ssh in another session with
ssh -p 2222 root@localhost

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

T.

cnxsoft
12 years ago

You can create the file “/etc/X11/xorg.conf” with the following content:

Section “Screen”
Identifier “Default Screen”
DefaultDepth 16
SubSection “Display”
# Viewport 0 0
Depth 16
Modes “800×600”
EndSubsectionEndSection

It will not really change the resolution, but it should expand the 640×480 window to 800×600. I haven’t found a way to do it. I’ve also tried “fbset -xres 800 -yres 600” which will change the resolution successfully in the command line, but will revert to 640×480 in LXDE.

cnxsoft
12 years ago

There is a better method to keep access rights and avoid a few issues (Provided by Jojopi in R-Pi Forums @ http://www.raspberrypi.org/forum/features-and-requests/qemu-emulation-working-cookbooks-required-for-available-distributions/page-2 (Post 22)

qemu-img resize raspberrypi-fedora-remix-14-r1.img 3712M
echo -e “dn2nnnpn2nnnpnwn” |fdisk raspberrypi-fedora-remix-14-r1.img
losetup -o $((206848*512)) /dev/loop7 raspberrypi-fedora-remix-14-r1.img
fsck -fy /dev/loop7
resize2fs /dev/loop7
losetup -d /dev/loop7then you can start qemu as follows:

qemu-system-arm -M versatilepb -cpu arm1176 -m 192 -hda raspberrypi-fedora-remix-14-r1.img
-kernel zImage -append “root=/dev/sda2” -serial stdio -redir tcp:2222::22

You would also be able to dd that image (with your modifications) to the SD Card.

Sander
Sander
12 years ago

I was able to compile my own kernel / zImage with IPv6 and tuntap (TUN/TAP) compiled in. After installing and starting miredo-client, the emulated ARM system has a public IPv6 address, and I can ssh into it from anywhere. Handy!

Instructions used: http://www.cnx-software.com/2011/10/18/raspberry-pi-emulator-in-ubuntu-with-qemu/
The ARM zImage with IPv6 and tuntap is on http://www.appelboor.com/dump/zImage-ipv6-tuntap

Sander
Sander
12 years ago

Help needed:

1) how is the speed of your emulated Fedora-ARM-systems? I must say mine is extremely slow when / with running Firefox. I wonder what this means for the real raspi … is it really faster, or about the same speed … 🙁 ? The 256MB RAM is quite little for a browser like Firefox and even Midori.

2) as a user, is there a GUI option to shutdown the system? I do see a Logout, but no Shutdown. So I now login as root and then type “shutdown now”. I prefer an easier method.

bob_binz
bob_binz
12 years ago

@ Sander

For 2. try clicking Run and typing halt

BBz

Sander
Sander
12 years ago

@bob_binz: does that work for you? I get:

[sander@raspi ~]$ halt
userhelper must be setuid root
[sander@raspi ~]$

bob_binz
bob_binz
12 years ago

@ Sander
Hmm, it did. Maybe I’d previously sudo’d in a term session and it remembered my password. Actually, I’ve now set the ability for root to login to the GUI and the logout windows for root also displays shutdown and restart buttons, so I’m looking into adding them for users (or a power group.) Will let you know if I get anywhere.

BBz

John
John
11 years ago

If you select the “Logout” option you should then get a menu with options to Shutdown, Reboot, Suspend, Hibernate, Logout or Cancel.

You do not need to be root to do this..

Bob
Bob
11 years ago

Thanks for this, if anyone else wants to try this on Windows, I managed to get it working by using the following command line –

qemu-system-arm -kernel kernel-qemu -cpu arm1176 -M versatilepb -serial stdio -append “root=/dev/sda2 panic=1” -hda archlinuxarm-19-04-2012.img -clock dynticks

The -clock dynticks was the key thing that helped. Hope this helps others, good luck!

Khadas VIM4 SBC