Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting up qemu network [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
mounty1
l33t
l33t


Joined: 06 Jul 2006
Posts: 726
Location: Queensland

PostPosted: Wed Jun 02, 2010 11:17 pm    Post subject: Setting up qemu network [SOLVED] Reply with quote

Hello, I'm asking this here rather than in networking and security because there isn't actually a problem with Gentoo etc.; only with my lack of understanding of networks and IP.

I want to set up a qemu machine. The host is Gentoo on ppc. The guest will also be Gentoo, on x86 of course. This is because I want to run one pre-compiled x86 binary. That's all OK; I can install qemu and run it, connected to a hard disk image and to the minimal installation ISO image.

My question is: what networking arguments are required ? This is what the network should provide:
  • The x86 binary is an X client so it should be able to connect to the X server running on the host.
  • Similarly, files are used by the x86 binary so the host will be running an NFS server and the the guest will be a client thereof.
  • The guest must connect to the internet for emerge updates. The host's internet connection is eth0 which is a DHCP client and picks up an address in the 192.168.0.0/24 range (typically 192.168.0.215).
That might require two separate network connections to the guest.

Qemu networking seems very complicated but I'm just hoping that someone has been this way before and knows what to do. I'm hoping for an answer in terms of "Set up a tap interface in your host kernel and connect it to eth0 with this command. Supply these arguments when you start qemu. Inside the guest, you will have two interfaces, eth0 and eth1. Configure them thus."
_________________
Michael Mounteney


Last edited by mounty1 on Sun Jun 06, 2010 11:34 pm; edited 1 time in total
Back to top
View user's profile Send private message
jormartr
Apprentice
Apprentice


Joined: 02 Jan 2008
Posts: 174

PostPosted: Fri Jun 04, 2010 12:11 am    Post subject: Reply with quote

I'm glad you decided to use qemu :)

You can use a bridge approach, like described on the network section on the kvm entry in the gentoo wiki (kvm is qemu with cpu assistance, same binary executable): http://en.gentoo-wiki.com/wiki/Kvm#Networking_2

You can also try vde. It makes a virtual switch, and with default configuration (ie: emerge vde; /etc/init.d/vde start), it creates a tap interface, connected to a virtual switch, to which you can connect vm's. This way you have vm's connected to your host. Use this on the qemu invocation:

-net vde,vlan=0 -net nic,vlan=0

If you need access to the outside, you may setup masquerading.

If you want to have a bridged setup with vde, you should configure more manually.

EDIT: forgot to mention, that to use vde, you need the vde flag set on qemu-kvm. Also, if you are using qemu, use the 0.12.X qemu-kvm, instead of the qemu 0.9.1 on portage.
Back to top
View user's profile Send private message
mounty1
l33t
l33t


Joined: 06 Jul 2006
Posts: 726
Location: Queensland

PostPosted: Sun Jun 06, 2010 11:34 pm    Post subject: elsewhere Reply with quote

See https://forums.gentoo.org/viewtopic-t-830920-highlight-.html.
_________________
Michael Mounteney
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum