User avatar
emercer
Posts: 165
Joined: Sun Aug 07, 2011 1:54 am
Location: Sao Paulo, Brazil
Contact: Website

Re: Emulating a RasPi on Windows

Wed Sep 21, 2011 9:47 pm

For those of us too eager to test if our favorite piece of Linux code will run on ARM, I've written a little tutorial on setting QEMU up in Windows, setting up TAP and installing Debian. Here's the link:

http://cronicasredux.blogspot......el-on.html

Just so the lazy don't feel discouraged: I've made a couple of torrents. This one is for LXDE:



http://www.mybtfiles.com/torre...../95884788/

And this one is for Debian with Gnome:



http://www.mybtfiles.com/torre...../84004592/

All you need is QEMU for Windows. I've made a fat-free, ARM-emulation-only ZIP file you can download here:

http://www.megaupload.com/?d=IQ57NN7O

Unzip'em all to the same folder, run the .BAT file for the corresponding image and voilá! Instant Linux on ARM.

P.S. the username on the pre-baked images is always user and the passwords are always password. Classy, I know. If you want to get internet on those images, you'll have to follow the tutorial anyways, at least the part about networking. Also, be sure to name your TAP adapters TAP32 like mine, or edit the .BAT files to match the name you use.

Edit:
Bumsfallera uploaded the two images to his FTP server, might be faster than the torrent. (his own words)

LXDE version: ftp://88.198.117.140/download/.....-en-uk.rar
Gnome version: ftp://88.198.117.140/download/.....-en-uk.rar

goldenfenix tells us that to get 800x600 resolution we need to create /etc/X11/xorg.conf with:

Section "Screen"
Identifier "Default Screen"
DefaultDepth 16
SubSection "Display"
# Viewport 0 0
Depth 16
Modes "800x600"
EndSubsection
EndSection

And then reboot.

Efcis
Posts: 28
Joined: Thu Sep 01, 2011 8:26 pm

Re: Emulating a RasPi on Windows

Wed Sep 21, 2011 10:06 pm

Hi Eduardo !

Thanks for your great work, and your blog post, which is very educational !

Just a question : How much total space is required on the disk to install the "full package" (QEMU + ARM emulation image) ? I'm a bit short on space here, and I'd like to get this information before starting.

obarthelemy
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm

Re: Emulating a RasPi on Windows

Wed Sep 21, 2011 10:42 pm

And here's proof... and the victory shot:


User avatar
emercer
Posts: 165
Joined: Sun Aug 07, 2011 1:54 am
Location: Sao Paulo, Brazil
Contact: Website

Re: Emulating a RasPi on Windows

Wed Sep 21, 2011 11:38 pm

@Efcis: LXDE takes about 2.5GB (Base system + Desktop environment). A full Gnome install took me 4GB. Both installs are using 8GB image files, so I'm just discounting declared free space. It might be they take a little more space to complete (depends on temp file usage, etc.)

Edit: Now I've noticed you probably mean the pre-baked images. QEMU itself is extra small, just about 4MB, so the entire package (QEMU + one system image) takes 7.9GB and each extra image will add another 7.9GB to your disk usage.

Efcis
Posts: 28
Joined: Thu Sep 01, 2011 8:26 pm

Re: Emulating a RasPi on Windows

Fri Sep 23, 2011 9:16 am

Thanks Eduardo

ARM emulation image torrent download in progress, despite the low count of sources though (the complete file isn't even available right now).

User avatar
emercer
Posts: 165
Joined: Sun Aug 07, 2011 1:54 am
Location: Sao Paulo, Brazil
Contact: Website

Re: Emulating a RasPi on Windows

Fri Sep 23, 2011 4:47 pm

Sorry 'bout that, I think my ISP is traffic-shaping my fibre connection... It's seeding oh-so-slow, and when I go to sleep and leave only uTorrent on to seed, it disconnects me :/

obarthelemy
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm

Re: Emulating a RasPi on Windows

Fri Sep 23, 2011 5:31 pm

i'm downloading them as we speak and will keep seeding for the foreseeable future

SlayingDragons
Posts: 67
Joined: Wed Sep 14, 2011 3:17 am

Re: Emulating a RasPi on Windows

Mon Sep 26, 2011 1:23 am

I've been downloading all day, (turns out that it takes forever with only 2 peers,) and am now stuck at 89.7 percent along with all the peers I'm connected to. Need a seeder with 100%, otherwise this torrent is dead.

User avatar
emercer
Posts: 165
Joined: Sun Aug 07, 2011 1:54 am
Location: Sao Paulo, Brazil
Contact: Website

Re: Emulating a RasPi on Windows

Mon Sep 26, 2011 1:32 am

I'm online and seeding... It's gosh-darn slow, blame it on my ISP, but I have 100% of both files on constant seed.

obarthelemy
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm

Re: Emulating a RasPi on Windows

Mon Sep 26, 2011 6:31 am

I'm seeing the lxde version at 96% w/ 60 leeches, and gnome at 45% w/ 21 leeches.

obarthelemy
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm

Re: Emulating a RasPi on Windows

Mon Sep 26, 2011 10:35 am

lxde one has finished seeding. Maybe you can stop seeding it to help the gnome one catch up, while we seed lxde ?

obarthelemy
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm

Re: Emulating a RasPi on Windows

Mon Sep 26, 2011 3:58 pm

something weird is going on with the torrents. I've completed the lxde download, with a ratio of 2, a few hours ago. I've put it back on seed, at high priority.
1- It currently sees only 5 seeds, which is weird, swarms with a slow seeder usually complete a lot within a few minutes of the first full download
2- I see 22 leeches, but barely ever connect to them even though my port is correctly forwarded and open
3- when I do connect, upload speed is pitiful (1k-ish), even though I've set that seed at high priority / high bandwidth and am not even saturating my bandwidth with the other torrents (which I've put on low bandwidth as a "belt and suspenders" mesure).

User avatar
emercer
Posts: 165
Joined: Sun Aug 07, 2011 1:54 am
Location: Sao Paulo, Brazil
Contact: Website

Re: Emulating a RasPi on Windows

Mon Sep 26, 2011 4:13 pm

Funny behaviors galore: I see no peers connected to the LXDE torrent, none whatsoever. Maybe it's time I took you advice and concentrate on seeding Gnome :P

User avatar
emercer
Posts: 165
Joined: Sun Aug 07, 2011 1:54 am
Location: Sao Paulo, Brazil
Contact: Website

Re: Emulating a RasPi on Windows

Mon Sep 26, 2011 4:14 pm

Also: dtpoirot has a neat trick on another thread to set QEMU CPU affinity on Windows:

http://www.raspberrypi.org/for.....38;t=616.0

dtpoirot
Posts: 11
Joined: Fri Sep 23, 2011 3:42 pm

Re: Emulating a RasPi on Windows

Tue Sep 27, 2011 3:14 pm

I am trying to build my own image but I can't login!

I can see the following:
Debian GNU/Linux 6.0 demo tty1
demo login:

...but the keyboard is ignored.

<Ctrl><Alt> releases the mouse grab but <Ctrl><Alt>3 or <Ctrl><Alt>2 have no effect...

dtpoirot
Posts: 11
Joined: Fri Sep 23, 2011 3:42 pm

Re: Emulating a RasPi on Windows

Tue Sep 27, 2011 3:39 pm

Hum... Too Many Fingers on Keyboard Error.

Apparently all is well after I take the '-k en-us' out of the boot line.

Your Milage May Vary...

I can now even run 'apt-get install dropbear' for SSH support!

User avatar
emercer
Posts: 165
Joined: Sun Aug 07, 2011 1:54 am
Location: Sao Paulo, Brazil
Contact: Website

Re: Emulating a RasPi on Windows

Tue Sep 27, 2011 9:16 pm

@dtpoirot glad you fixed it on your own ;) One more edit to the tutorial, I guess. Seems like adding "-k en-us" to the command line, although needed if you must emulate US-International, can lead to aberrant input behavior if superfluous.

dtpoirot
Posts: 11
Joined: Fri Sep 23, 2011 3:42 pm

Re: Emulating a RasPi on Windows

Wed Sep 28, 2011 2:48 pm

I have been using QEMU for quite a while and usually have several running at once.

I have just done an installation on a QCOW2 format file. This format 'grows' as needed rather than taking all the disk space ahead of time. Not as good for performance (fragmentation) but easier on the host hard drive

My Debian+Dropbear SSH file system is 726,976 bytes
My Debian+SSH+LXDE file system is 1,104,000 bytes
<emercer's> LDXE file system (with Open Office) is 8,290,304 bytes

User avatar
emercer
Posts: 165
Joined: Sun Aug 07, 2011 1:54 am
Location: Sao Paulo, Brazil
Contact: Website

Re: Emulating a RasPi on Windows

Wed Sep 28, 2011 11:34 pm

The raw files are, indeed, full-sized (they occupy the same 8GB they fit). But they are the only format you can mount as a drive (you need Linux for that little trick) and, if you're using NTFS, they can be compressed with little to no performance impact (I usually have a partition specially for my VMs with compression on). My Gnome partition reports 8GB, but uses only 2.6GB. The LXDE is even leaner, at 1.7GB.

stuporhero
Posts: 125
Joined: Fri Aug 19, 2011 2:02 pm

Re: Emulating a RasPi on Windows

Thu Sep 29, 2011 9:51 am

I'll get this uploaded to my torrent server asap...

goldenfenix
Posts: 8
Joined: Thu Sep 29, 2011 1:20 pm

Re: Emulating a RasPi on Windows

Thu Sep 29, 2011 2:45 pm

it is possible to get 800x600 in my qemu virtual lxde ?

dtpoirot
Posts: 11
Joined: Fri Sep 23, 2011 3:42 pm

Re: Emulating a RasPi on Windows

Thu Sep 29, 2011 2:52 pm

<emercer>
The raw files are, indeed, full-sized (they occupy the same 8GB they fit). But they are the only format you can mount as a drive

???

By that, do you mean that you mount the Rasp-Pi file system image on your native i86/x64 Intel Linux host?

My installation is working just fine with a QCOW2 image format.

I just use scp to copy files once I have Dropbear installed.

...then there is always NBD (Network Block Device protocol):
http://qemu.weilnetz.de/qemu-d.....es_005fnbd

- dan

User avatar
emercer
Posts: 165
Joined: Sun Aug 07, 2011 1:54 am
Location: Sao Paulo, Brazil
Contact: Website

Re: Emulating a RasPi on Windows

Thu Sep 29, 2011 7:06 pm

Quote from dtpoirot on September 29, 2011, 15:52
By that, do you mean that you mount the Rasp-Pi file system image on your native i86/x64 Intel Linux host?


Exactly. Sometimes I need a way to transfer files to/from emulator disk images without first booting them (for example, to extract a kernel image or to inject a working module on an otherwise unbootable VM). It happens all the time when trying different emulated hardware combinations.

User avatar
emercer
Posts: 165
Joined: Sun Aug 07, 2011 1:54 am
Location: Sao Paulo, Brazil
Contact: Website

Re: Emulating a RasPi on Windows

Thu Sep 29, 2011 7:17 pm

Quote from goldenfenix on September 29, 2011, 15:45
it is possible to get 800x600 in my qemu virtual lxde ?


So far no one has been able to convince the versatilepb platform to output anything other than 640x480. I don't know if it's a software or emulated-hardware limitation, but I'm guessing the later.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6051
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Emulating a RasPi on Windows

Fri Sep 30, 2011 10:36 am

The chip it's emulating can display at much higher resolutions. It may be that they didn't emulate everything properly (ARM is somewhat neglected by qemu), or something up with the software. I think SDL can enter higher resolution modes in the framebuffer without any problems.

We could try to re-do it with boards other than versatile and see if we have better luck.

Return to “Other projects”