davidh2k
Posts: 1
Joined: Fri Jul 20, 2012 3:12 pm

Re: Emulating Raspberry Pi in Windows the easy way

Fri Jul 20, 2012 4:45 pm

@Dilligaf Which image did you use? raspbmc or openelec? (if you are looking for a real openelec image, you can find them here: http://sparky0815.de/openelec-download- ... fat-files/)

I tried openelec and already got stuck in the booting process. Qemu has problems mounting the fat partition i think...

Erm, and i get the same error as you in the emulated pi, if I try to run the snes emulator retroarch.
http://www.frost-software.com/blog/2012 ... ry-pi.html

-----

Another Problem i encountered: the Space Left in your supplied images here is barely minimal (200 in the old one, 300 in the new one).
In read in the thread that someone expanded the size of the image in the Emulator. Could you provide a small tutorial onto that? It would be very helpfull.

MfG David

mjlally
Posts: 49
Joined: Thu May 10, 2012 9:08 pm
Location: Reading, UK

Re: Emulating Raspberry Pi in Windows the easy way

Fri Jul 20, 2012 8:01 pm

davidh2k wrote:@Dilligaf Which image did you use? raspbmc or openelec? (if you are looking for a real openelec image, you can find them here: http://sparky0815.de/openelec-download- ... fat-files/)

I tried openelec and already got stuck in the booting process. Qemu has problems mounting the fat partition i think...

Erm, and i get the same error as you in the emulated pi, if I try to run the snes emulator retroarch.
http://www.frost-software.com/blog/2012 ... ry-pi.html

-----

Another Problem i encountered: the Space Left in your supplied images here is barely minimal (200 in the old one, 300 in the new one).
In read in the thread that someone expanded the size of the image in the Emulator. Could you provide a small tutorial onto that? It would be very helpfull.

MfG David



To resize your image open a windows command prompt and navigate your way to the folder where the image is stored.

Then run this command (for the Raspbian image file)

qemu-img resize 2012-07-15-wheezy-raspbian.img 3.7G

if you would like and have space for a 3.7 gigabyte image. I couldn't get it to make 4 gig or above but that should get you going.

The command format is

qemu-img resize filename size

in the example I gave 3.7G is 3.7 gigabytes.

There is some reasonably good documentation on qemu in the Docs folder in your download, qemu-doc.html, if anybody gets stuck or wants to play around with other options for running the Pi emulation.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Emulating Raspberry Pi in Windows the easy way

Fri Jul 20, 2012 8:06 pm

Does qemu-img do the the filesystem resizing as well (or does it, as I suspect, just do the partition resize - the equivalent of the "fdisk" steps if you were on a "real pi") ?
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

mjlally
Posts: 49
Joined: Thu May 10, 2012 9:08 pm
Location: Reading, UK

Re: Emulating Raspberry Pi in Windows the easy way

Sat Jul 21, 2012 11:29 am

For anybody who already has a raspbian image downloaded and just wants the qemu folder and kernel, it can now be downloaded here

http://sourceforge.net/projects/rpiqemu ... o%20image/

Just put your image in the folder and change the file named in the run.bat file as described in the readme file.

mjlally
Posts: 49
Joined: Thu May 10, 2012 9:08 pm
Location: Reading, UK

Re: Emulating Raspberry Pi in Windows the easy way

Sat Jul 21, 2012 11:33 am

Joe Schmoe wrote:Does qemu-img do the the filesystem resizing as well (or does it, as I suspect, just do the partition resize - the equivalent of the "fdisk" steps if you were on a "real pi") ?
Hi Joe, thanks for highlighting this, I will have a look when I get a chance.

Has anybody tried resizing the image then doing a resize in the config menu that comes up on the first boot?

solthom
Posts: 1
Joined: Sun Jul 22, 2012 1:09 pm

Re: Emulating Raspberry Pi in Windows the easy way

Sun Jul 22, 2012 1:10 pm

Hey been following this topic and ordered a pi myself. I try to get Openelec to work in qemu emulator. But i get errors booting. Has anybody resolved this problem? I would immensly appreciate it.

I daresay im a total noobie to linux in general. But im trying to lern stuff.
So hoping i receive some help.

Rgds

Dilligaf
Posts: 283
Joined: Wed May 23, 2012 6:48 pm

Re: Emulating Raspberry Pi in Windows the easy way

Sun Jul 22, 2012 3:00 pm

davidh2k wrote:@Dilligaf Which image did you use? raspbmc or openelec? (if you are looking for a real openelec image, you can find them here: http://sparky0815.de/openelec-download- ... fat-files/)

I tried openelec and already got stuck in the booting process. Qemu has problems mounting the fat partition i think...

Erm, and i get the same error as you in the emulated pi, if I try to run the snes emulator retroarch.
http://www.frost-software.com/blog/2012 ... ry-pi.html

-----

Another Problem i encountered: the Space Left in your supplied images here is barely minimal (200 in the old one, 300 in the new one).
In read in the thread that someone expanded the size of the image in the Emulator. Could you provide a small tutorial onto that? It would be very helpfull.

MfG David
As I said, i used the raspbian xbmc image found on this forum raspbian-xbmc-2012-07-19.img

User avatar
PIstolero
Posts: 101
Joined: Mon Jul 23, 2012 6:28 am
Location: paradise city, where the grass is green and the girls are pretty

Re: Emulating Raspberry Pi in Windows the easy way

Mon Jul 23, 2012 6:43 am

I tested the download with the qemu and the raspian image.
I changed the run.bat with:
qemu-system-arm.exe -k de -M versatilepb -cpu arm1176 -hda 2012-07-15-wheezy-raspbian.img -kernel kernel-qemu -m 192 -append "root=/dev/sda2" -redir tcp:2222::22
To get -k de working I had to copy the folder qemu\BIOS\Keymaps to qemu\Keymaps
After that I run sudo dpkg-reconfigure keyboard-configuration for the german Keyboard
To get 800x600 (1024x768 didn´t work) I had to add a xorg.conf file found here:
http://www.raspberrypi.org/phpBB3/viewt ... f=2&t=3149
With -redir tcp:2222::22 I redirect ssh to port 2222 locahost and with Xming on my W7 64bit box and putty I can run X apps in Windows (you mus enable X11 forwarding in putty) out of the box, I didn´t install anything on the raspian image.

Image

User avatar
PIstolero
Posts: 101
Joined: Mon Jul 23, 2012 6:28 am
Location: paradise city, where the grass is green and the girls are pretty

Re: Emulating Raspberry Pi in Windows the easy way

Mon Jul 23, 2012 7:20 am

Sorry for the double posting, I was not able to edit the posting above, here is the software I am using:
Xming : http://sourceforge.net/projects/xming/
Putty: http://www.chiark.greenend.org.uk/~sgta ... nload.html
Screenshot: http://s7.directupload.net/file/d/2960/kvmhwqso_png.htm

gyeben
Posts: 150
Joined: Tue Jun 19, 2012 6:38 pm
Location: Hungary, Eger

Re: Emulating Raspberry Pi in Windows the easy way

Tue Jul 24, 2012 6:03 pm

Hi!

Thanks for the new version, mjlally, it works great! :)
Although I can see that the emulated CPU has been changed, unfortunately there isn't so much speed improvments.

It's nice to see the Raspberry logo at booting and it's also great that you could get the latest official Raspbian image to work with qemu (which I couldn't).

So for one more time: thanks for your work!

Wolfram23
Posts: 73
Joined: Thu Jul 19, 2012 6:50 pm

Re: Emulating Raspberry Pi in Windows the easy way

Thu Jul 26, 2012 4:51 am

I feel like an idiot but I don't even know how to install software like OpenELEC. The website's instructions are assuming I'm building an SD card... obviously I don't have one yet! How can I download and install OpenELEC to this QEMU Rasbian build? I'm running Windows 7.

I tried their instruction to run:
git clone git://github.com/OpenELEC/OpenELEC.tv.git
but I got "bash: git: command not found" error

EDIT: I have it downloaded and unzipped, not sure what to do now. The "Install" file did nothing.

mjlally
Posts: 49
Joined: Thu May 10, 2012 9:08 pm
Location: Reading, UK

Re: Emulating Raspberry Pi in Windows the easy way

Wed Aug 01, 2012 2:34 pm

Wolfram23 wrote:I feel like an idiot but I don't even know how to install software like OpenELEC. The website's instructions are assuming I'm building an SD card... obviously I don't have one yet! How can I download and install OpenELEC to this QEMU Rasbian build? I'm running Windows 7.

I tried their instruction to run:
git clone git://github.com/OpenELEC/OpenELEC.tv.git
but I got "bash: git: command not found" error

EDIT: I have it downloaded and unzipped, not sure what to do now. The "Install" file did nothing.
Hi there,
are you trying to run OpenELEC in qemu?

Wolfram23
Posts: 73
Joined: Thu Jul 19, 2012 6:50 pm

Re: Emulating Raspberry Pi in Windows the easy way

Thu Aug 02, 2012 1:51 am

Yes, that was the idea. I want to try several media players.

EDIT: If I replace the img file (2012-07-15-wheezy-raspbian.img), is it just a straight replacement (as in, remove this file and insert new one), or is there some other config I need to change to point to the new one? Alternatively, can I rename a new image file to this exact name?

mjlally
Posts: 49
Joined: Thu May 10, 2012 9:08 pm
Location: Reading, UK

Re: Emulating Raspberry Pi in Windows the easy way

Thu Aug 02, 2012 11:15 am

Wolfram23 wrote:Yes, that was the idea. I want to try several media players.

EDIT: If I replace the img file (2012-07-15-wheezy-raspbian.img), is it just a straight replacement (as in, remove this file and insert new one), or is there some other config I need to change to point to the new one? Alternatively, can I rename a new image file to this exact name?
The file name needs to be changed in the run.bat file unless you rename the file to the same name as you suggest (this could get confusing though if you are trying a lot of images!)

Some images will work but I have had trouble with others. On occasion this has been possible to fix using a different kernel but not always. I will have a look if I get a chance. It might be worth looking through the forum to see how installing openelec on a real pi is working for people.

Wolfram23
Posts: 73
Joined: Thu Jul 19, 2012 6:50 pm

Re: Emulating Raspberry Pi in Windows the easy way

Thu Aug 02, 2012 5:28 pm

Great, thanks. I'll try this out. Haven't had near enough time on it yet. As far as installation goes, the wiki only seemed to have a guide on flashing an SD card rather than a straight download and install from the Pi itself. I'll figure it out eventually - I'm a Linux noob. Regardless, thanks for the help.

Dredia
Posts: 4
Joined: Tue Aug 07, 2012 7:52 am

Re: Emulating Raspberry Pi in Windows the easy way

Tue Aug 07, 2012 7:55 am

Hi all,
I have a question you ask, how can I boot from my sd card that it is in drive E:
I do not know what I need to change the run.bat.

Code: Select all

qemu-system-arm.exe -M versatilepb -cpu arm1176 -hda 2012-07-15-wheezy-raspbian.img -kernel kernel-qemu -m 192 -append "root=/dev/sda2"
Thank you for your help.

JeffreySun
Posts: 7
Joined: Thu Jul 19, 2012 1:10 am

Re: Emulating Raspberry Pi in Windows the easy way

Wed Aug 08, 2012 6:39 am

I host a web server in the emulator. It works when I access in with NetSurf. I use ifconfig in the emulator to show the ip address. When I access it in the browser of Windows OS, it fails. How can I know which IP address should be used to access the web server on the emulator?

User avatar
PIstolero
Posts: 101
Joined: Mon Jul 23, 2012 6:28 am
Location: paradise city, where the grass is green and the girls are pretty

Re: Emulating Raspberry Pi in Windows the easy way

Thu Aug 09, 2012 10:56 am

You should add -redir tcp:8080::80 to your .bat file, it should be:

Code: Select all

qemu-system-arm.exe -M versatilepb -cpu arm1176 -hda 2012-07-15-wheezy-raspbian.img -kernel kernel-qemu -m 192 -append "root=/dev/sda2" -redir tcp:8080::80
Now you should see your webserver in IE or firefox with:

Code: Select all

localhost:8080
Take care that port 8080 is free.

stafil
Posts: 4
Joined: Tue Jul 31, 2012 11:29 am

Re: Emulating Raspberry Pi in Windows the easy way

Mon Aug 13, 2012 10:29 am

Hi all,

how i change screen resolution in qemu to 1600x900?

Thx

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Emulating Raspberry Pi in Windows the easy way

Mon Aug 13, 2012 2:17 pm

PIstolero wrote:You should add -redir tcp:8080::80 to your .bat file, it should be:
That seems to me to be the hard way to do it.

When I set up Pi-in-QEMU-under-WIndows, I used the "TAP" device, which has the effect of "bridging" the QEMU session to the local LAN. I.e., the Pi session gets an IP address from your LAN DHCP server and is accessible directly. No need for any redirection.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

JeffreySun
Posts: 7
Joined: Thu Jul 19, 2012 1:10 am

Re: Emulating Raspberry Pi in Windows the easy way

Tue Aug 14, 2012 11:03 am

"-redir tcp:8080::80" works for me.
Joe Schmoe wrote
When I set up Pi-in-QEMU-under-WIndows, I used the "TAP" device, which has the effect of "bridging" the QEMU session to the local LAN.
What does the "TAP" device means?

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Emulating Raspberry Pi in Windows the easy way

Tue Aug 14, 2012 12:34 pm

JeffreySun wrote:"-redir tcp:8080::80" works for me.
I've no doubt that it works - it just seems like the hard way. You are adding an additional layer of NAT to the process. Still, if it works, it works... But I've found the "bridging" option better than the "NAT" options - in whatever emulator software I am using.
What does the "TAP" device means?
Read here: http://www.smallbulb.net/2012/225-emula ... spberry-pi

Although, having just checked, I see that there's nothing there about TAP or openvpn. Oh well...

So, you may have to do some surfing around to find it, but the basic idea is:

1) Install openvpn on your Windows system. This will install one or more "TAP" network devices on your system. I have no idea what the letters "TAP" stand for.
2) Use the "network control panel" to setup a "bridge" between your real connection (usually ethernet) and the "TAP" device.
3) Change your QEMU.BAT file to say -net nic -net if=tap

It should "just work".
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
PIstolero
Posts: 101
Joined: Mon Jul 23, 2012 6:28 am
Location: paradise city, where the grass is green and the girls are pretty

Re: Emulating Raspberry Pi in Windows the easy way

Wed Aug 29, 2012 3:31 pm

Qemu 1.2.0 will be comming soon (05.09.2012):
http://wiki.qemu.org/Planning/1.2
Changelog:
http://wiki.qemu.org/ChangeLog/Next

I tested if the performance with nbench Qemu 1.1.0 (from the download) vs. 1.2.0rc1 (cross compiled for Windows on my Linux Box). The performance is about the same, some tests seems to be a bit slower, other tests seems to be faster in nbench.
Qemu1.1.0.jpg
Qemu1.1.0 nbench
Qemu1.1.0.jpg (54.35 KiB) Viewed 15070 times
Qemu1.2.0rc1.jpg
Qemu1.2.0rc1 nbench
Qemu1.2.0rc1.jpg (54.53 KiB) Viewed 15070 times

thradtke
Posts: 491
Joined: Wed May 16, 2012 5:16 am
Location: Germany / EL

Re: Emulating Raspberry Pi in Windows the easy way

Tue Sep 04, 2012 9:53 am

I have a question: The /boot directory is empty under QEMU. Is there a noob-proof way to mount the FAT partition to actually see the firmware?
Rocket Scientist.

User avatar
PIstolero
Posts: 101
Joined: Mon Jul 23, 2012 6:28 am
Location: paradise city, where the grass is green and the girls are pretty

Re: Emulating Raspberry Pi in Windows the easy way

Fri Sep 07, 2012 10:44 am

Some infos for updating, just do:
apt-get update && apt-get upgrade
The Kernel will not be updated because you are using a kernel for qemu, to update the kernel (and maybe qemu too) just do this:
http://www.raspberrypi.org/phpBB3/viewt ... 01#p168001
Then you are up to date

Return to “Beginners”

Who is online

Users browsing this forum: Douglas6 and 50 guests