* [Qemu-devel] qemu-vde-howto
@ 2004-06-03 0:02 Jim C. Brown
2004-06-03 15:09 ` [Qemu-devel] loadvm someone? Johannes Schindelin
0 siblings, 1 reply; 9+ messages in thread
From: Jim C. Brown @ 2004-06-03 0:02 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 266 bytes --]
Attached is the working draft for using VDE with qemu.
Comments, suggestions, and improvements are welcome.
P.S. The "Credits" section is a definite work in progress.
--
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
[-- Attachment #2: qemu-vde-HOWTO --]
[-- Type: text/plain, Size: 5681 bytes --]
Using VDE with Qemu HOWTO
by Jim Brown
27 May 2004
Version 0.0
-----------------------------------------------------------------------------
Introduction
Copyright
What is qemu?
What is VDE?
Configuring and Installing VDE
Installation
vdeq & vdeqemu
User-mode networking
How to enable user-mode networking
Firewall configuration
Setting up qemu
How to set up the guest OS
Credits
-----------------------------------------------------------------------------
Introduction
Copyright
Copyright (c) 2004 Jim Brown.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is available at http://www.gnu.org/licenses/fdl.txt
What is qemu?
Qemu is a FAST! processor emulator by Fabrice Bellard, available at
http://fabrice.bellard.free.fr/qemu/. It is capable of emulationg the x86 and
PowerPC processors with support for other processors on the way. The original
purpose of qemu was to allow running x86-specific Linux applications, such as
WINE or DosEmu, on non-x86 systems. However, qemu has expanded into becoming
a full-fledged emulator. On the x86 side, it is capable of running Linux,
MS-DOS, Windows 95/98/Me, Windows NT/2k, Windows XP, Solaris, OpenBSD, and
FreeBSD. See http://fabrice.bellard.free.fr/qemu/ossupport.html for the full
listing.
This howto assumes that you have already installed and set up qemu.
What is VDE?
VDE is short for Virtual Distributed Ethernet. VDE, written by
Renzo Davoli, is based off of uml_switch by Jeff Dike. It is available at
http://sourceforge.net/projects/vde/. It has many uses, the main one providing
support for networking with emulated computers. (Not just qemu, but support
for user-mode linux and Bochs also exists). VDE must be set up and installed by
root, but the programs which use it do not need root privligies.
This howto will walk you through the simple process of installing
VDE and setting up qemu to use it.
-----------------------------------------------------------------------------
Configuring and Installing VDE
Installation
You may obtain the source code at http://sourceforge.net/projects/vde/.
The version of VDE which I used was 1.4.1, but this HOWTO should apply to all
versions.
Once you have downloaded the source code, extract it. I assume you
will have extracted it to /space/vde. Go into that directory, and simply type
"make" followed by "make install". Now you should have vde_switch in /usr/bin.
vdeq & vdeqemu
Now cd into the qemu directory. Type "make". This will build vdeq.
Qemu on its own only supports full networking with tuntap, which requires
root priviliges or an exposed /dev/net/tun. There is a -user-net option, but
that is not as useful as full networking. In order for qemu to use VDE, it must
be passed the file descriptor for a tun device. Futhermore the tun device itself
must already be configured to use VDE. vdeq sets this up and passes it to qemu
via the -tun-fd switch.
There is no "make install". Instead, you just manually copy vdeq to
/usr/bin. It might also be helpful to copy (or hard link) vdeq to vdeqemu.
vdeq requires that the location of the qemu binary be passes to it as the
first command line parameter, but vdeqemu only needs the options you want to
pass to qemu. vdeqemu will locate the qemu binary itself.
-----------------------------------------------------------------------------
User-mode Networking
How to enable user-mode networking
The following commands will need to be run as root:
# vde_switch -tap tap0 -daemon
# ifconfig tap0 <ip>
# chmod 777 /tmp/vde.ctl
The vde_switch command will run VDE in the background. The -tap tap0
parameter tells VDE to set up the device tap0 using tuntap. -daemon runs
vde_switch in the background.
<ip> is the ip address of the gateway you want to use for the guest
OS(es). For example:
# ifconfig tap0 192.168.1.254
will make 192,.168.1.254 the gateway, and your guest OS(es) will belong
to the subnet 192.168.1.0 with a netmask of 255.255.255.0 and an ip address of
192.168.1.XXX (where you get to pick the XXX).
Note that you must run this before you run your firewall. I found it helpful
to put this into a script, and have the script load before the firewall does.
Firewall configuration
You will need to enable masquerading between tap0 and your local area
network (for example, eth0). You will also need to enable masquerading between
tap0 and ppp0 if you use a dialup connection to the internet. The commands
# echo "1" > /proc/sys/net/ipv4/ip_forward
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
will allow you to enable this manually.
-----------------------------------------------------------------------------
Setting up qemu
How to set up the guest OS
Set up the guest OS so that the default route is through the gateway
ip, <ip> (for example 192.168.1.254). Also set up the subnet and netmask
parameters as appropriate (for example 192.168.1.0 and 255.255.255.0).
The guest OS should see the ethernet device and be able to use it to access
the gateway. (Caveat: I haven't been able to do this for MS-DOS, and for Minix
2.0.4 I had to apply a patch to qemu since Minix is broken.) Also don't forget
to set up the IP of the guest OS itself (for example 192.168.1.1).
-----------------------------------------------------------------------------
Credits
This HOWTO relied heavily on the documentation that Renzo wrote for
vde-1.4.1.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Qemu-devel] loadvm someone?
2004-06-03 0:02 [Qemu-devel] qemu-vde-howto Jim C. Brown
@ 2004-06-03 15:09 ` Johannes Schindelin
2004-06-03 15:37 ` Fabrice Bellard
0 siblings, 1 reply; 9+ messages in thread
From: Johannes Schindelin @ 2004-06-03 15:09 UTC (permalink / raw)
To: qemu-devel
Hi,
does anybody else than me use the loadvm command?
I run into a few problems:
- a saved KNOPPIX state gives an error, when loaded first,
if I load a second time, it works
- a saved Windows state does not start any longer
My suspicion is that some "hardware" state is not saved, and so those
virtual devices are not reinitialized correctly. However, when I load the
state a 2nd time, they have been initialized somehow.
Anyone has an idea where to fix it?
Ciao,
Dscho
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] loadvm someone?
2004-06-03 15:09 ` [Qemu-devel] loadvm someone? Johannes Schindelin
@ 2004-06-03 15:37 ` Fabrice Bellard
2004-06-03 15:48 ` Johannes Schindelin
2004-06-03 21:39 ` [Qemu-devel] Re: loadvm someone? Gabriel Ebner
0 siblings, 2 replies; 9+ messages in thread
From: Fabrice Bellard @ 2004-06-03 15:37 UTC (permalink / raw)
To: qemu-devel
Johannes Schindelin wrote:
> Hi,
>
> does anybody else than me use the loadvm command?
>
> I run into a few problems:
> - a saved KNOPPIX state gives an error, when loaded first,
> if I load a second time, it works
> - a saved Windows state does not start any longer
>
> My suspicion is that some "hardware" state is not saved, and so those
> virtual devices are not reinitialized correctly. However, when I load the
> state a 2nd time, they have been initialized somehow.
>
> Anyone has an idea where to fix it?
The save/load VM feature is not finished because not all devices save
their state (it should be easy to finish). There are also some problems
if you load a VM on a computer with a different clock speed from the one
on which it was saved. Moreover, no backward compatibility between the
saved state file format is currently maintainted.
Fabrice.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] loadvm someone?
2004-06-03 15:37 ` Fabrice Bellard
@ 2004-06-03 15:48 ` Johannes Schindelin
2004-06-04 0:46 ` [Qemu-devel] Linux Tip: switch to console Johannes Schindelin
2004-06-03 21:39 ` [Qemu-devel] Re: loadvm someone? Gabriel Ebner
1 sibling, 1 reply; 9+ messages in thread
From: Johannes Schindelin @ 2004-06-03 15:48 UTC (permalink / raw)
To: qemu-devel
Hi,
On Thu, 3 Jun 2004, Fabrice Bellard wrote:
> Johannes Schindelin wrote:
> The save/load VM feature is not finished because not all devices save
> their state (it should be easy to finish). There are also some problems
> if you load a VM on a computer with a different clock speed from the one
> on which it was saved. Moreover, no backward compatibility between the
> saved state file format is currently maintainted.
That is no problem for me: I am going to use it for development of the VNC
support, and later to avoid booting in the emu (loadvm beats the boot in
terms of startup time...)
Ciao,
Dscho
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Qemu-devel] Re: loadvm someone?
2004-06-03 15:37 ` Fabrice Bellard
2004-06-03 15:48 ` Johannes Schindelin
@ 2004-06-03 21:39 ` Gabriel Ebner
1 sibling, 0 replies; 9+ messages in thread
From: Gabriel Ebner @ 2004-06-03 21:39 UTC (permalink / raw)
To: qemu-devel
Hello,
Fabrice Bellard wrote:
> There are also some problems
> if you load a VM on a computer with a different clock speed from the one
> on which it was saved.
You face exactly the same problem with cpufreq (which changes the clock
speed on a running system).
Gabriel.
--
Gabriel Ebner - reverse "ta.renbeleirbag@eg"
==> Please don't CC me! I'm reading the list.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Qemu-devel] Linux Tip: switch to console
2004-06-03 15:48 ` Johannes Schindelin
@ 2004-06-04 0:46 ` Johannes Schindelin
2004-06-04 8:40 ` Maurizio Monge
2004-06-04 11:09 ` Fabrice Bellard
0 siblings, 2 replies; 9+ messages in thread
From: Johannes Schindelin @ 2004-06-04 0:46 UTC (permalink / raw)
To: qemu-devel
Hi,
just found a way to switch from X to a text console with Linux as a guest
OS:
- while not grabbing, move your mouse into the qemu window
- Press down Ctrl+Alt, keep them pressed while moving out of that window
- Now release them
- Move your mouse back into qemu's window
- Press F1 (or F2, F3, ...)
It was so simple that I didn't think of it earlier ...
Of course, this only works if that auto-releasing patch is not applied...
Ciao,
Dscho
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] Linux Tip: switch to console
2004-06-04 0:46 ` [Qemu-devel] Linux Tip: switch to console Johannes Schindelin
@ 2004-06-04 8:40 ` Maurizio Monge
2004-06-04 10:07 ` Johannes Schindelin
2004-06-04 11:09 ` Fabrice Bellard
1 sibling, 1 reply; 9+ messages in thread
From: Maurizio Monge @ 2004-06-04 8:40 UTC (permalink / raw)
To: qemu-devel
Alle Friday 04 June 2004 02:46, Johannes Schindelin ha scritto:
> Hi,
>
> just found a way to switch from X to a text console with Linux as a guest
> OS:
> - while not grabbing, move your mouse into the qemu window
> - Press down Ctrl+Alt, keep them pressed while moving out of that window
> - Now release them
> - Move your mouse back into qemu's window
> - Press F1 (or F2, F3, ...)
>
> It was so simple that I didn't think of it earlier ...
> Of course, this only works if that auto-releasing patch is not applied...
>
> Ciao,
> Dscho
running "chvt 1" in an xterm wasn't ok?
Ciao
Maurizio
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] Linux Tip: switch to console
2004-06-04 8:40 ` Maurizio Monge
@ 2004-06-04 10:07 ` Johannes Schindelin
0 siblings, 0 replies; 9+ messages in thread
From: Johannes Schindelin @ 2004-06-04 10:07 UTC (permalink / raw)
To: monge, qemu-devel
Hi,
On Fri, 4 Jun 2004, Maurizio Monge wrote:
> running "chvt 1" in an xterm wasn't ok?
No: X was not responding. That was the reason I had to change to console.
Also, I didn't know the command "chvt". Thanks!
Ciao,
Dscho
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] Linux Tip: switch to console
2004-06-04 0:46 ` [Qemu-devel] Linux Tip: switch to console Johannes Schindelin
2004-06-04 8:40 ` Maurizio Monge
@ 2004-06-04 11:09 ` Fabrice Bellard
1 sibling, 0 replies; 9+ messages in thread
From: Fabrice Bellard @ 2004-06-04 11:09 UTC (permalink / raw)
To: qemu-devel
Johannes Schindelin wrote:
> Hi,
>
> just found a way to switch from X to a text console with Linux as a guest
> OS:
> - while not grabbing, move your mouse into the qemu window
> - Press down Ctrl+Alt, keep them pressed while moving out of that window
> - Now release them
> - Move your mouse back into qemu's window
> - Press F1 (or F2, F3, ...)
>
> It was so simple that I didn't think of it earlier ...
> Of course, this only works if that auto-releasing patch is not applied...
You can also use the new monitor command:
sendkey ctrl-alt-f1
Fabrice.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2004-06-04 11:08 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-03 0:02 [Qemu-devel] qemu-vde-howto Jim C. Brown
2004-06-03 15:09 ` [Qemu-devel] loadvm someone? Johannes Schindelin
2004-06-03 15:37 ` Fabrice Bellard
2004-06-03 15:48 ` Johannes Schindelin
2004-06-04 0:46 ` [Qemu-devel] Linux Tip: switch to console Johannes Schindelin
2004-06-04 8:40 ` Maurizio Monge
2004-06-04 10:07 ` Johannes Schindelin
2004-06-04 11:09 ` Fabrice Bellard
2004-06-03 21:39 ` [Qemu-devel] Re: loadvm someone? Gabriel Ebner
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).