Skip to contentSkip to conversation

Morphix booting in 1024x768 resolution and Win32 questions

Qemu-devel Jean-Michel POURE 4 participants 7 messages Mar 16, 2004 – Mar 17, 2004

lore
Share & tools
lore
#0 lore raw

Dear all,

Fist of all, thanks for this great work on Qemu.

For years now, I have been hanging around the Bochs project trying to run various OSes. On the long run, I hope that both projects can collaborate.

I made some screenshots of qemu CVS version booting Morphix with VBE drivers in 1024x768 resolution. Installation to disc was not tested yet.

The screenshots can be found here:
http://developer.pgadmin.org/jean-michel/screenshots/qemu_morphix1.png
http://developer.pgadmin.org/jean-michel/screenshots/qemu_morphix2.png

Now, some questions:

1) Network
I could not find any information how to install a tun0 virtual interface. Any link? Would it be possible to add a small Debian howto on the web page?

2) Win2K and WinXP pro
After booting images of the installation CDs:

qemu cvs version:
+ Win2K displays a blue screen
+ WinXP freezes with nearly 100% activity.

qemu from Debian SID:
+ both systems rash after disc formatting.

3) Bug report
Is there a way to send you a bug report using gdb? Can you add information on the web page for other users?

Cheers,
Jean-Michel

#1 lore raw
Quoted 4 lines · On Tue, 16 Mar 2004 15:42:26 +0100 Jean-Michel POURE <[email protected]> wrote:

1) Network
I could not find any information how to install a tun0 virtual interface. Any link? Would it be possible to add a small Debian howto on the web page?

For information about setting tun support up see bochs user manual
http://bochs.sourceforge.net/cgi-bin/topper.pl?name=New+Bochs+Documentation&url=
http://bochs.sourceforge.net/doc/docbook/user/book1.html (beware line warp). The linux-test package and its documentation from QEMU homepage
(http://fabrice.bellard.free.fr/qemu/) may also be useful (that was what I used).

- Markus

#3 lore raw
Quoted 6 lines · On Tue, 16 Mar 2004 16:16:09 +0100 Jean-Michel POURE <[email protected]> wrote:

I found an answer in the Bochs manual:

#!/bin/bash
/sbin/ifconfig $1 192.168.0.101

Is that right?

Looks right, altough 192.168.x.x addresses don't seem to work for me.

If you are intrested, here is a step-by-step instructions to run xterm from linux-test distribution (take a network connection from quest to host):

1) Download and extract linux-test package from QEMU homepage

2) Configure your kernel to support tun and tap (see bochs manual)

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

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).

I hope this made everything clear.

Happy hacking,

Markus

#4 lore raw

Il Tue, 16 Mar 2004 18:38:41 +0200, Markus Niemistö <[email protected]> ha scritto:

Quoted 4 lines

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

Quoted 8 lines

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

Quoted 27 lines

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.

Quoted 7 lines

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

Signature · 5 lines
----------------------------------------
Non ci toglieranno mai....la LIBERTA'!!!
Luca Ferroni
www.cs.unibo.it/~fferroni/
----------------------------------------
#5 lore raw
Quoted 10 lines · Luca Ferroni

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

EEEEK!

Kids, never ever ever try this at home! You have just granted access to any account without any password to anyone who can access your account (read, someone who gets you to run a simple script or exploits the newest über exploit for the leet mailclient[tm] you were running)

Something that would be a bit more sane would read:
user ALL = NOPASSWD: /sbin/ifconfig

and for someone even more paranoid:
user ALL = NOPASSWD: /sbin/ifconfig tun*

please, do yourself a favour and use one of the above instead of granting access to all around the system. the password isn't really that much of a pain to write, and it provides security.

Regards, Sami

#6 lore raw

Il Wed, 17 Mar 2004 15:48:40 +0200, Sami Haahtinen <[email protected]> ha scritto:

Quoted 22 lines
Quoted 10 lines · Luca Ferroni

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

EEEEK!

Kids, never ever ever try this at home! You have just granted access to any account without any password to anyone who can access your account (read, someone who gets you to run a simple script or exploits the newest über exploit for the leet mailclient[tm] you were running)

Something that would be a bit more sane would read:
user ALL = NOPASSWD: /sbin/ifconfig

Quoted 6 lines

and for someone even more paranoid:
user ALL = NOPASSWD: /sbin/ifconfig tun*

please, do yourself a favour and use one of the above instead of granting access to all around the system. the password isn't really that much of a pain to write, and it provides security.

sorry I used that configuration for test because tun0 didn't work properly. thank you for the suggestion,
I have never used sudo before and so I left that configuration after the test succeded

bye

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