User avatar
Sailing_Nut
Posts: 40
Joined: Sat Mar 03, 2012 10:29 pm

Re: Qemu on Windows

Fri Mar 16, 2012 1:36 am

I was wondering if anyone out there has managed to get networking working with Qemu for Windows.

I have been trying for quite some time with zero success. I am beginning to wonder if I am tilting at windmills.

If anyone has had success I would be extrememy appreciative if you would share how you got it to work!

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

Re: Qemu on Windows

Fri Mar 16, 2012 6:48 am

I am also interested in this.

In one of the other QEMU threads, someone claimed success using the TAP network device from "openvpn".  I haven't had a chance to test this yet, but it seemed likely to work from what I saw.
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
Toad King
Posts: 157
Joined: Sun Dec 18, 2011 8:03 pm

Re: Qemu on Windows

Fri Mar 16, 2012 7:36 am

I have it working with the OpenVPN TAP driver. After you get it set up and bridged to your real connection, run Qemu with these extra parameters:

-net nic -net tap,ifname=TAP

Replace TAP with whatever you named the TAP adapter.

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

Re: Qemu on Windows

Fri Mar 16, 2012 8:09 am

Out of curiosity, how does this work?

I.e., supposed my local network is 192.168.197.* and my Windows machine is 192.168.197.82 and my TAP device is 192.168.197.173 (Obviously, I'm just making these numbers up), then what do I set the Linux "eth0" device to (inside QEMU)?
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
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: Qemu on Windows

Fri Mar 16, 2012 5:09 pm

Joe Schmoe said:


Out of curiosity, how does this work?

I.e., supposed my local network is 192.168.197.* and my Windows machine is 192.168.197.82 and my TAP device is 192.168.197.173 (Obviously, I'm just making these numbers up), then what do I set the Linux "eth0" device to (inside QEMU)?



Initially the emulated Pi is given a dynamic IP from the dynamic pool on your router. If you want to you can then assign it a static IP address. You can do this by creating a cfg-eth0 file in the /etc/sysconfig/network-scripts directory as described here:

http://thedaneshproject.com/po.....-in-linux/

Don't forget to scroll down in the eth0 static settings box or you will miss some settings that are required. I also added an extra line to the cfg-eth0 file to use my router as the DNS server:

DNS1=192.168.1.254

This gets auto-populated into /etc/resolv.conf during initialisation of the eth0 interface.

In my case I've given the emulated Pi a separate static IP address from the IP address of TAP adapter which is outside of the dynamic IP pool range of my router.

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

Re: Qemu on Windows

Fri Mar 16, 2012 5:20 pm

Oh - OK.  So you don't *have* to use static IP in the emulated Pi?  You can just use DHCP like normal...  The text made it sound like you *had* to use static IP.   In any case, note, just FYI, that I never use those if-up/down/sideways scripts.  I just use "ifconfig".

But, can you confirm these things (on the Windows side):

1) The TAP device will have a different IP address than the main Windows IP address.

2) It (the Windows TAP device) must be configured as static IP, not DHCP.  (And, if so, why?)
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
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: Qemu on Windows

Fri Mar 16, 2012 5:51 pm

Joe Schmoe said:


Oh - OK.  So you don't *have* to use static IP in the emulated Pi?  You can just use DHCP like normal...  The text made it sound like you *had* to use static IP.   In any case, note, just FYI, that I never use those if-up/down/sideways scripts.  I just use "ifconfig".

But, can you confirm these things (on the Windows side):

1) The TAP device will have a different IP address than the main Windows IP address.

2) It (the Windows TAP device) must be configured as static IP, not DHCP.  (And, if so, why?)



Yeah, by default it just uses DHCP and picks up an address from the router.

1) I've used the TAP with both the same address as the main Windows box and with a different IP address. Both appear to work OK. I did have to go back into the bridge device and retype the default gateway after Windows configured the bridge adapter when using the same address. I've also had them set up to use the same IP address for the TAP adapter, the Windows machine, and the emulated Pi,  and that didn't seem to cause any issues. I've currently got them configured to use separate IP addresses for my own clarity.

2) I don't know why. I just prefer to use static IPs for clarity

User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: Qemu on Windows

Fri Mar 16, 2012 6:13 pm

Joe Schmoe said:


I am also interested in this.

In one of the other QEMU threads, someone claimed success using the TAP network device from "openvpn".  I haven't had a chance to test this yet, but it seemed likely to work from what I saw.



I used qem-windows1.0.1 from here:

http://lassauge.free.fr/qemu/

To set up the OpenVPN TAP adapter I followed the instructions from here:

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

I'm running the Fedora Remix distribution and used various other postings and blogs to prepare the image.

It all seems to work fine and I haven't had any real issues with it yet. The one thing I haven't been able to get working with Qemu in Windows is the -VNC option. If this option is used then Qemu doesn't start, but there aren't any pertinent error messages. It may be that the VNC option isn't included in the Windows version

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

Re: Qemu on Windows

Fri Mar 16, 2012 6:33 pm

@fbutler:

Yes, that all agrees with my experience.  I haven't actually gotten it to work with TAP yet, simply because I don't have the machine (laptop) that I set this up on originally.  I expect to get it back sometime soon.

And, yes, as I've noted elsewhere, it annoys me that if you give it a command line option that it doesn't like, it just exits back to the prompt with no error message.

Question: In the Windows version, you don't really *need* the -vnc, because the graphics (when you run "startx") come up on the Windows desktop.  It had sort of been my impression that under Linux, you actually need -vnc to work, because that's the only way to see the graphics.  Is that true?  I say this because some people had complained about it starting up and booting, getting all the way to displaying a message about VNC, then hanging.  To which others replied, that's OK - it is doing what it is supposed to; all you need to do now is fire up a VNC viewer and all will be well.
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
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: Qemu on Windows

Fri Mar 16, 2012 6:43 pm

Joe Schmoe said:


@fbutler:

Yes, that all agrees with my experience.  I haven't actually gotten it to work with TAP yet, simply because I don't have the machine (laptop) that I set this up on originally.  I expect to get it back sometime soon.

And, yes, as I've noted elsewhere, it annoys me that if you give it a command line option that it doesn't like, it just exits back to the prompt with no error message.

Question: In the Windows version, you don't really *need* the -vnc, because the graphics (when you run "startx") come up on the Windows desktop.  It had sort of been my impression that under Linux, you actually need -vnc to work, because that's the only way to see the graphics.  Is that true?  I say this because some people had complained about it starting up and booting, getting all the way to displaying a message about VNC, then hanging.  To which others replied, that's OK - it is doing what it is supposed to; all you need to do now is fire up a VNC viewer and all will be well.

No, you don't need the -vnc option when using an emulator under Linux. I think people doing this may have been having issues with permissions caused by an erroneous "cp -r" command when resizing the image and just reverted to using the -vnc option as another way to access it. Under both Windows and Linux the Qemu Window opens and you can also access the emulated Pi using SSH.

For the sake of experimentation I've also set up a VNC server on the emulated Pi and accessed it with a Gnome Desktop environment successfully. The Gnome environment is currently much heavier (and slower) to run than the default desktop.


Return to “General discussion”