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.
- Download the image using BitTorrent raspberrypi-fedora-remix-14-r1.img.gz.torrent or via the HTTP link available on Raspberry Pi Download page.
- Decompress the image:
1gzip -d raspberrypi-fedora-remix-14-r1.img.gz - Download kernel 3.0.4 image for qemu, if you don’t have it yet.
1wget http://dl.dropbox.com/u/45842273/zImage - 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:
12dd if=/dev/zero of=rootfs3G.ext3 count=6M/sbin/mkfs.ext3 rootfs3G.ext3 - 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 - 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/:
12345git clone git://git.linaro.org/qemu/qemu-linaro.gitcd qemu-linaro./configure --target-list=arm-softmmumakesudo make install - 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:
1chmod 777 /tmp
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:
1ssh -p 2222 root@localhost
Once you followed those steps and selected graphical mode, you should see a login screen that looks like the one below.
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.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
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 »
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
Sorry, I’ve noticed keyboard input did not work after this post. I’ll try to make this work a bit later.
@ 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.
@ 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.
@ 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.
I’m going to bed so here are some fixes and debug info in case somebody wants to look into it. To fix the network issue: 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/ To resize the rootfs: dd if=raspberrypi-fedora-remix-14-r1.img of=fedora-pi.ext3 skip=206848 count=3246080 dd if=/dev/zero of=rootfs2G.ext3 count=3906250 /sbin/mkfs.ext3 rootfs2G.ext3 mkdir mnt mkdir mnt2 sudo mount -o loop fedora-pi.ext3 mnt sudo mount -o loop rootfs2G.ext3 mnt2 sudo cp mnt/* mnt2 -rf sudo umount mnt2 sudo umount mnt The keyboard does not work yet in LXDE apparently because the haldaemon cannot start [root@raspi ~]# hald –daemon=no –verbose=yes 09:07:33.433… Read more »
I’ve just fixed hald issue by change the ownership of hald directory: chmod haldaemon:haldaemon /var/cache/hald -R.
/etc/init.d/haldaemon start works fine.
However, It still did not fix the keyboard issue for me.
I’ve just updated the post with instructions to enable keyboard and network and resize the rootfs.
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
Thanks for the feedback. I’ve updated the instructions.
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.
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 »
@skyspy:
You need to open a VNC connection to 127.0.0.1:5900
On Ubuntu: vinagre localhost:5900
HTH
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 ~]#
@ Sander
It’s more like no IPv6 in the kernel I provided. It can be enabled by recompiling the kernel. Check the Kernel section in http://www.cnx-software.com/2011/10/18/raspberry-pi-emulator-in-ubuntu-with-qemu/ and add IPv6 support.
@ skyspy
I’ve never had this issue, actually qemu-system-arm will only show the line:
Uncompressing Linux… done, booting the kernel.
What’s the output of qemu-system-arm –version ?
@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
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.
Yes, I’ve noticed that, but I can’t even type when the screensaver is activated.
I have the same messages:
oss: Could not initialize DAC
oss: Failed to open
/dev/dsp'
/dev/dsp’oss: Reason: No such file or directory
oss: Could not initialize DAC
oss: Failed to open
oss: Reason: No such file or directory
audio: Failed to create voice
lm4549.out'
127.0.0.1:5900′VNC server running on
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.
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.
@ Brian
Depending on what you want to do you could also build some kernel modules or (easier) build missing features into the kernel, but most of what you need is already in the kernel zImage. Somebody already noticed IPv6 is missing in my kernel, so if you need it you’d have to rebuilt it.
@Jean-Luc Aufranc (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?
@ cnxsoft
Typos IMHO:
chmod haldaemon:haldaemon /var/cache/hald -R.
chown haldaemon:haldaemon /var/cache/hald -R.
Thank you for your howto!
@ Sander
OK, I’ll try to provide a kernel with IPv6 on Monday. If you don’t get one by Monday, just remind me.
@ alanyih
Oups, I must be the typo king ! Thanks for the correction and glad this little how-to helped you.
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.
@Jean-Luc Aufranc (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.
FYI:
As root, I removed the screensaver like this:
yum remove xscreensaver-base.armv5tel
No screensaver, so no screensaver login problem, I hope.
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?
@sander
Try that: http://www.cnx-software.com/2012/02/18/raspberry-pi-releases-1st-sd-card-image-debian-how-to-use-it-in-the-emulator/comment-page-2/#comment-6533
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
Have you run “chmod 777 /tmp” ?
Thanks cnxsoft – that did the trick. I get the desktop and I was able to check with firefox and network is OK, also.
Jason
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.
@ Morgaine
Yes, that password thing annoyed quite a few people. I don’t how to change it yet.
Here’s Kernel 3.1.9 with IPv6 support.
http://dl.dropbox.com/u/45842273/zImage_3.1.9_ipv6
@Jean-Luc Aufranc (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. 🙁
[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” … ?
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
PS: is my md5sum the same as yours?
$ md5sum raspberrypi-fedora-remix-14-r1.img
039673ad14ebe98f36697e461cabeb7c raspberrypi-fedora-remix-14-r1.img
@ Sander
The start sector you show in your comment is the same as the one in the post.
@ Sander
I propose you try to build your own kernel, it’s not that difficult and you won’t have to wait for me each time you need a new feature. If it fails, you can always comment with your error in the post explaining how to build the kernel.
@Jean-Luc Aufranc (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 … 🙂
@ 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
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.
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.
@ Sander
Here’s my kernel config: http://dl.dropbox.com/u/45842273/kernel_3.1.9.config
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.
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
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.
@ Sander 1. I haven’t used it that much (I haven’t started Firefox), but it ought to be slow. You can see the Bogomips are about 150 to 200 in the emulator, but the real hardware should be around 700 Bogomips so a few times faster. However, none of the current images uses the GPU to accelerated the GPU, so it will feel sluggish, probably worse than if you run Windows in a netbook with the default video driver (e.g. in safe mode). There is a long thread about performance on the Raspberry Pi forum http://www.raspberrypi.org/forum/general-discussion/how-slow-is-it , there are even… Read more »
@ Sander
For 2. try clicking Run and typing halt
BBz
@bob_binz: does that work for you? I get:
[sander@raspi ~]$ halt
userhelper must be setuid root
[sander@raspi ~]$
@ 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
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..
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!