qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luca Ferroni <luca.ferroni@studio.unibo.it>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Morphix booting in 1024x768 resolution and Win32 questions
Date: Wed, 17 Mar 2004 11:27:47 +0100	[thread overview]
Message-ID: <20040317112747.077bcc0e.luca.ferroni@studio.unibo.it> (raw)
In-Reply-To: <20040316183841.3c8c7ece.markus.niemisto@iki.fi>

Il Tue, 16 Mar 2004 18:38:41 +0200,  Markus Niemistö <markus.niemisto@iki.fi> ha scritto:

> 1) Download and extract linux-test package from QEMU homepage
> 
> 2) Configure your kernel to support tun and tap (see bochs manual)
> 

When I insert module tun in my kernel 2.6.4, I have to rebuild the link in devfs to make qemu working
this is the original link 		/dev/net/tun -> misc/net/tun
this is the modified link		/dev/net/tun -> /dev/misc/net/tun

> 3) Create a network script; put the following lines to the
> /etc/qemu-ifup file:
> 
> #!/bin/sh
> /sbin/ifconfig $1 172.20.0.1
> 
> and make the file executable: chmod 755 /etc/qemu-ifup
> 

The problem of root execution is the script /etc/qemu-ifup which calls ifconfig
It is not enough to set permissions 755 to this script
You can use sudo, 

#!/bin/sh
sudo /sbin/ifconfig $1 172.20.0.1

and put your user in /etc/sudoers file

user	ALL=(ALL) 	NOPASSWD: ALL

Obviously you need sudo package installed in your system


> 4) Start X server with TCP listening turned on: startx -listen_tcp
> 
> 5) Allow X connections from 172.20.0.2 (the quest). Run:
> 
> xhost +172.20.0.2
> 
> 6) Run QEMU with linux-test distribution:
> 
> qemu -hda /tmp/linux-test/linux.img
> 
> 7) Setup DISPLAY variable in quest. Type in linux-test prompt:
> 
> export DISPLAY=172.20.0.1:0
> 
> 8) Run xterm from the quest:
> 
> /usr/X11R6/bin/xterm
> 
> You can also ping 172.20.0.1 or run xlogo or whatever
> 
> And voilá! You have an xterm running in QEMU but it is displayed on your
> host's X server. Network works! I have to run QEMU as root, so if this
> doesn't work, try running QEMU as root.
> 
> So what really happens is that you see the QEMU quest as 172.20.0.2 and
> it sees your computer as 172.20.0.1.
> 
> The following is untested but AFAIK it should work. In order to access
> the Internet from the QEMU quest, set the gateway and nameserver of the
> host to the gateway and nameserver you normally use on your computer.
> You may have to do some additional route configuration, but I am not
> sure (and cannot help you with that becouse I don't know that much
> about Linux).
> 

In your host OS you have to build iptables with NAT support in your kernel.
then you have to install iptables package and do the following:

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

And so, you can surf the web and make net update to your guest ... great!

I hope this help
bye


-- 
----------------------------------------
Non ci toglieranno mai....la LIBERTA'!!!
Luca Ferroni
www.cs.unibo.it/~fferroni/
----------------------------------------

  reply	other threads:[~2004-03-17 10:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-16 14:42 [Qemu-devel] Morphix booting in 1024x768 resolution and Win32 questions Jean-Michel POURE
2004-03-16 15:10 ` Markus Niemistö
2004-03-16 15:16 ` Jean-Michel POURE
2004-03-16 16:38   ` Markus Niemistö
2004-03-17 10:27     ` Luca Ferroni [this message]
2004-03-17 13:48       ` [Qemu-devel] " Sami Haahtinen
2004-03-17 14:20         ` Luca Ferroni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040317112747.077bcc0e.luca.ferroni@studio.unibo.it \
    --to=luca.ferroni@studio.unibo.it \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).