Hi All, I''ve recently installed QEMU on Solaris 10 x86 from opensolaris (http://opensolaris.org/os/project/qemu/downloads/SUNWqemu-0.8.2_REV_2006.10.18-sol10-i386-opt.pkg.bz2) I''ve built an XP client, but I''m struggling to determine the best options for networking. Ideally, I''d like to be able to have either: an XP QEMU guest pingable from the QEMU host only or an XP QEMU guest pingable from any host. I don''t want to have to mess around port forwarding to achieve this if possible. I understand this _may_ be possible using a tap device ? I have installed the tun/tap driver & openvpn from http://www.whiteboard.ne.jp/~admin2/tuntap/ But I''m struggling to find out how to configure this. Many thanks in advance Mark.
> Hi All, > > I''ve recently installed QEMU on Solaris 10 x86 from > opensolaris > (http://opensolaris.org/os/project/qemu/downloads/SUNW > qemu-0.8.2_REV_2006.10.18-sol10-i386-opt.pkg.bz2)> I''ve built an XP client, but I''m struggling to > determine the best options for networking. > > Ideally, I''d like to be able to have either: > an XP QEMU guest pingable from the QEMU host onlyAFAIK, this is not doable with the current code base. Martin incorporated some patches I got from another Sun Qemu afficiando into the original blastwave Qemu that used libpcap to make this work, but we never got those patches to the main Qemu CVS archive, and I don''t think Martin has had a chance to integrate those patches into the current code.> > or > an XP QEMU guest pingable from any host. > don''t want to have to mess around port forwarding to > achieve this if possible.Well, with the current slirp implementation, ICMP is not passable unless you want to write some code to make that work. I''m not even sure you could pass ICMP using the slirp stack, but not being a networking expert, I don''t know this for sure.> > I understand this _may_ be possible using a tap > device ? > > I have installed the tun/tap driver & openvpn from > http://www.whiteboard.ne.jp/~admin2/tuntap/ > But I''m struggling to find out how to configure this.Having done this with a linux host using the bridging tools, this is so simple. Unfortunately, Solaris doesn''t appear to have the same bridging capabilities, and even with the tun/tap patches, bridging is a bit dicey, though it did work in the 0.7.0 Qemu that appeared on blastwave. IIRC, if you were bridging with that version, the host couldn''t contact the guest. Ben -- This message posted from opensolaris.org
I have SUNWqemu-0.8.2, REV=2006.10.14-sol8-sparc-opt.pkg.gz on solaris sparc and tun/tap v1.1 and openvpn v2.0.9 and bridge. I installed windows 2003 on qemu but I cannot connect to the local net from the guest. Someone might they say to me if there exists some possibility of configure the qemu-guest to access the local network same to qemu-host? Please help me. Regards, Ivanovik -- This message posted from opensolaris.org
> I have SUNWqemu-0.8.2, > REV=2006.10.14-sol8-sparc-opt.pkg.gz on solaris sparc > and tun/tap v1.1 and openvpn v2.0.9 and bridge. I > installed windows 2003 on qemu but I cannot connect > to the local net from the guest. > Someone might they say to me if there exists some > possibility of configure the qemu-guest to access the > local network same to qemu-host? > Please help me. > Regards, > IvanovikI didn''t think that Martin incorporated the tun/tap patches into the 0.8.2 release he did, so you''re stuck with using the "-net user -net nic,model="<your choice, rtl8139 is best probably>" If you set your client to dhcp, the qemu process provides dhcp services and default route to the client. Your client should pickup a 10.0.2.15 address and the default route of the client should be 10.0.2.2, but you should also be able to access the host via it''s default ip address. HTH, Ben -- This message posted from opensolaris.org
Ben Taylor wrote:>I didn''t think that Martin incorporated the tun/tap patches into >the 0.8.2 release he did, so you''re stuck with using the >"-net user -net nic,model="<your choice, rtl8139 is best probably>" > >Yep, not _yet_, but it will be.>If you set your client to dhcp, the qemu process provides dhcp >services and default route to the client. Your client should pickup >a 10.0.2.15 address and the default route of the client should be >10.0.2.2, but you should also be able to access the host via it''s >default ip address. > >Right. --Martin>HTH, > >Ben >
HEllo, I''m also looking for something that let me have a networkable XP host inside my Solaris10 server. So to have it clear, is there any possibility to have this working ? (i.e. to have at lease IE browsing internet) and if it is, how ? I''ve been playing a while with the same version of qemu whitout fonding the trick ! :-) Thank you for your input ! (I''ve build 52 on a x86 (Pentium HT)) -- This message posted from opensolaris.org
C-EDGE wrote:>HEllo, > >I''m also looking for something that let me have a networkable XP host inside my Solaris10 server. So to have it clear, is there any possibility to have this working ? (i.e. to have at lease IE browsing internet) and if it is, how ? > >I''ve been playing a while with the same version of qemu whitout fonding the trick ! :-) >Thank you for your input ! > > >Hi! I always prefer to respond in full detail, but cannot do so before Friday afternoon ... Till then, except some other reader is faster ... -MB>(I''ve build 52 on a x86 (Pentium HT)) >-- >This message posted from opensolaris.org >_______________________________________________ >qemu-discuss mailing list >qemu-discuss at opensolaris.org >http://opensolaris.org/mailman/listinfo/qemu-discuss > > >
Hi again, Ok I''ll wait :-) Have a good day ! -- This message posted from opensolaris.org
> HEllo, > > I''m also looking for something that let me have a > networkable XP host inside my Solaris10 server. So to > have it clear, is there any possibility to have this > working ? (i.e. to have at lease IE browsing > internet) and if it is, how ?this is dead easy. when you start qemu, add -net user. You XP client should be set to DHCP, and assuming your Solaris host has a valid network connection and can resolve DNS (or even if you have an external proxy from the Solaris host), this should jsut work. The qemu guest (XP) will get a 10.0.2.15 address, and the default route is 10.0.2.2, which technically is a proxy address for the qemu process. Using the slirp stack it will translate that packet and send it on its way.> I''ve been playing a while with the same version of > qemu whitout fonding the trick ! :-)even the 0.7.0 version of qemu for Solaris could do this. -- This message posted from opensolaris.org
Hello, Back from Holidays :-) and hence had time to test this. Here is the command that let me have a working Windows XP with network enabled : /opt/SUNWqemu/bin/qemu -hda /zones/qemu/xpfull.img -net user -net nic,model=rtl8139 -cdrom /dev/dsk/c1t1d0s2 -boot c And beware of the owner and rights for your .img file :-) I''ll now try to have the qemu accelerator working :-) HTH -- This message posted from opensolaris.org
I got some diffs for a TAP device and preliminary results show it working on the 0.9.0 code. Hopefully, we''ll be able to get this into CVS RSN. -- This message posted from opensolaris.org
> Hi All, > > I''ve recently installed QEMU on Solaris 10 x86 from > opensolaris > (http://opensolaris.org/os/project/qemu/downloads/SUNW > qemu-0.8.2_REV_2006.10.18-sol10-i386-opt.pkg.bz2) > > I''ve built an XP client, but I''m struggling to > determine the best options for networking. > > Ideally, I''d like to be able to have either: > an XP QEMU guest pingable from the QEMU host only > > or > an XP QEMU guest pingable from any host. > don''t want to have to mess around port forwarding to > achieve this if possible. > > I understand this _may_ be possible using a tap > device ? > > I have installed the tun/tap driver & openvpn from > http://www.whiteboard.ne.jp/~admin2/tuntap/ > But I''m struggling to find out how to configure this.Patches were submitted to qemu-devel with tap support for Solaris, as well as a SUID script to create the tap and initialize it''s parameters, and then call a script to start qemu, passing in the parameter for the tap file descriptor. In the clients, you''ll set a static IP address to the endpoint of the tunnel that is created. The host can be reached on the start point. IE, default sets up a tunnel like: tap0: flags=1000851<UP,POINTOPOINT,RUNNING,MULTICAST,IPv4> mtu 100 index 15 inet 192.168.1.250 -> 192.168.1.10 netmask 25.255.255.0 ether a:0:20:98:dd:cc Using DamnSmallLinux as an example, I set the IP address of eth0 in the qemu guest to 192.168.1.10 and then can ssh to the host via "ssh -l user 192.168.1.250". I''m told the bridging module from that site can be used, and the only thing that /etc/qemu-ifup needs is the commadns to do the bridge. Let me know how it works. BTW, current patches also include support for kqemu support for Solaris 10. I won''t guarantee it works on all version of 10, but it works in S10U3. Ben -- This message posted from opensolaris.org
So at the moment there is no way to get this guest host from other hosts on the same network? I installed all the Tap/Tun stuff but it doesn''t create the /dev/tap0 device or at least I can see it in ifconfig or /dev/tap0. I want to be able to access this from my network.. From the qemu guest I can access the network and the internet just fine. I have to say it is Fast, very fast - I am using the kqemu module. I have this installed on OpenSolaris b61 on a Intel Core 2 duo e6300 box. I need a Linux distro with a 2.6 kernel... So until {if ever} I can make a zone. I am gonna use this. I am planning to setup a PackeFence host via this... We''ll see how this goes. Message was edited by: tmano -- This message posted from opensolaris.org
I have installed tun/tap,openvpn and bridge.But I could not see /dev/tap0 or /dev/tun0 except /dev/tun and /dev/tap.My OS is solaris 10 x86 u3,qemu version is 0.9.0.Here is my start script #qemu -hda windows/win2003/win2003.img -boot c -net nic -net tap -m 384 ifconfig: setifflags: SIOCSLIFFLAGS: tap0: Invalid argument /etc/qemu-ifup: could not launch network script Could not initialize device ''tap'' And qemu-ifup script: #!/bin/ksh # /etc/qemu-if: QEMU''s TAP network setup script for Solaris # $1 = tap0, tap1, ... if [ -z "$1" ] then echo "Usage: $0 interface" exit 1 fi DEV=${1%%[0-9]} PPA=${1##*[a-z]} # # You are expected to use network addresses for # the guests some non-used network as it relates # to your host to setup the private network # between the HOST and the QEMU Guest # NETMASK="255.255.255.0" # # OS can be defined by the shell script that # sol_qemu_tap calls to initialize QEMU so you # can have predictable IP addresses for # the QEMU Guest (though you still have to set # them in the Guest) # case "${OS}" in s10) HOST_IP="192.168.1.25${PPA}" GUEST_IP="192.168.1.1${PPA}" ;; winxp) HOST_IP="192.168.2.250" GUEST_IP="192.168.2.10" ;; win2k3) HOST_IP="192.168.3.250" GUEST_IP="192.168.3.10" ;; *) HOST_IP="192.168.1.25${PPA}" GUEST_IP="192.168.1.1${PPA}" ;; esac #set -x /sbin/ifconfig $1 ${HOST_IP} destination ${GUEST_IP} netmask ${NETMASK} up exit $? -- This message posted from opensolaris.org
I have downloaded sol_qemu_tap that wrapper for TAP, run the script #./sol_qemu_tap dsl.sh Now I can see the tap0 when qemu is running. # ifconfig tap0 tap0: flags=1000851<UP,POINTOPOINT,RUNNING,MULTICAST,IPv4> mtu 1500 index 34 inet 192.168.10.250 --> 192.168.10.10 netmask ffffff00 ether a:0:20:1b:dd:b Where 192.168.10.250 is the address of the QEMU Host and 192.168.10.10 is the address assigned to the QEMU Guest. Below is QEMU host(solaris 10 x86 u3) interface''s status: # ifconfig iwi0 iwi0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 index 32 inet 192.168.1.10 netmask ffffff00 broadcast 192.168.1.255 ether 0:e:35:d4:75:b3 When the QEMU guest(windows 2003) boot,I changed the network configuration ip address:192.168.10.10 netmasks:255.255.255.0 default gateway:192.168.10.250 But QEMU guest could''t communicate with QEMU host,the QEMU guest could''t receive anything packet,could''t ping QEMU host,why? -- This message posted from opensolaris.org
Does TUN/TAP need openvpn running? I didn''t run openvpn when running QEMU -- This message posted from opensolaris.org
---- stevens <teawater at vip.163.com> wrote:> Does TUN/TAP need openvpn running? > I didn''t run openvpn when running QEMUNo, you do not need the openvpn. The TUN/TAP module is used to do the fhe following: 1) TAP device is created with a private network between the host and the guest, and full network access (IE no port filtering occurs), though if the guest also needs access to external hosts (the internet, a local network), you are probably best served by creating one TAP (local host access) and using -net user using QEMU''s internal slirp firewall. 2) TAP device with the bridge module gives full access to all nodes outside of the host. Due to the way the bridge module works, unfortunately, the guest cannot see the host and vice versa. Again, access to the host could be accomplished using -net user though may be messy since you will likely be using DHCP for both the -net user and the Bridge. Probably best to use two taps. One for local host access and the other for the bridge. Ben
---- stevens <teawater at vip.163.com> wrote:> I have downloaded sol_qemu_tap that wrapper for TAP, > run the script > #./sol_qemu_tap dsl.shI assume you''ve modified the dsl.sh script to point at Solaris appropriate stuff. dsl.sh was just a short name for damn-small-linux.> Now I can see the tap0 when qemu is running. > # ifconfig tap0 > tap0: flags=1000851<UP,POINTOPOINT,RUNNING,MULTICAST,IPv4> mtu 1500 index 34 > inet 192.168.10.250 --> 192.168.10.10 netmask ffffff00 > ether a:0:20:1b:dd:b > Where 192.168.10.250 is the address of the QEMU Host and 192.168.10.10 is the address assigned to the QEMU Guest.so far so good.> Below is QEMU host(solaris 10 x86 u3) interface''s status: > # ifconfig iwi0 > iwi0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 index 32 > inet 192.168.1.10 netmask ffffff00 broadcast 192.168.1.255 > ether 0:e:35:d4:75:b3ok. wifi interface. If you didn''t know, don''t try to bridge a TAP to the wifi interface. No wired interface?> When the QEMU guest(windows 2003) boot,I changed the network configuration > ip address:192.168.10.10 > netmasks:255.255.255.0 > default gateway:192.168.10.250 > But QEMU guest could''t communicate with QEMU host,the QEMU guest could''t receive > anything packet,could''t ping QEMU host,why?Which interface are you using in the Win2003 guest? It looks like you''ve followed the how-to for networking, but Win2003 is a bit of a beasty. I havent used 2003 in quite a while, and you may have to load the realtek 8139 driver, and see if that fixes it. The default ne2000 driver in Win2003 didn''t work IIRC. Ben
Thank you for your reply. I want to access Internet in QEMU guest,so I had tried two meanings. (1) I have modified the dsl.sh and qemu-ifup script #cat dsl.sh #!/bin/ksh # qemu.sh: QEMU wrapper script # updated: 04/25/07 # Author: Sittichai Palingsong # Modified by: Ben Taylor # ##################################################### # # Script variables you should set for QEMU invocation # # QEMU_HOME is where you installed qemu # QEMU_HOME=/usr/local # # default location for the i386 qemu emulation # QEMU="${QEMU_HOME}/bin/qemu" # # QEMU_DEBUG is the source directory where the # unstripped binaries reside # QEMU_DEBUG=/export/src/qemu/051807/qemu # # GUESTMEM is the amount of memory that the qemu guest # allocates. By default, it''s 128MB. # GUESTMEM="256" # # which Keyboard layout. (see # ${QEMU_HOME}/share/qemu/keymaps for other choices) # KEYSYMS="-k en-us" # # BOOTDEV should be {a,c or d}. a for floppy, # c for the disk device, d for CD/DVD or ISO image. # BOOTDEV="c" # ##################################################### # # Default audio settings # # Which audio hardware to use: # Valid sound card names (comma separated): # pcspk PC speaker # sb16 Creative Sound Blaster 16 # es1370 ENSONIQ AudioPCI ES1370 # #-soundhw all will enable all of the above # leave "" to disable sound hw to the QEMU VM # AUDIO="-soundhw all" # ##################################################### # # Default network settings. # # If no -net settings are used, the default will be # "-net user -net nic", which means your qemu guest # will have to support the ne2000 pci NIC (rtl8029) # and will get a 10.0.2.15 address from the qemu''s # "internal" dhcp server. (If running Solaris or # OpenSolaris in a qemu guest, you will need the # modified ni driver in the ITU at # http://www.tools.de/opensource/solaris/itu ) # # The realtek 8139 is a more useful adapter and # is supported natively in most OS''s or has good # drivers. Solaris has support for this nic. # # Note: PING does not work with -net user. This # is due to the slirp stack, so if you''re testing # connectivity, try something simple like # telnet, ssh or http. ftp generally requires # a "-redir" option to work. # #NETWORK="-net user -net nic,model=rtl8139" # NETWORK="-net tap -net nic,model=rtl8139" # # setup to use vnc instead of a direct screen # VNC="-vnc :4" SCRIPT=${0##*/} OS=${SCRIPT%.sh} # # This variable is used in /etc/qemu-ifup to determine the # IP address of the local TAP address to use (for communication # between the guest and host) export OS #HDAIMG="${OS}.img" HDAIMG="/export/home/stevens/windows/win2003/win2003.img" #FDIMG="floppy.img" #CDROMDEV="${OS}.iso" #CDROMDEV="/dev/dsk/c1t0d0s2" while getopts ab:c:df:h:m:t: name do case $name in a) AUDIO="-soundhw all" ;; b) BOOTDEV="${OPTARG}" ;; c) CDROMDEV="${OPTARG}" ;; d) QEMU="${QEMU_DEBUG}" ;; f) FDIMG="${OPTARG}" ;; h) HDAIMG="${OPTARG}" ;; m) GUESTMEM="${OPTARG}" ;; t) TAP_FD="${OPTARG}" NETWORK="-net nic,model=rtl8139 -net tap,fd=${TAP_FD}" ;; ?) printf "Usage: %s: options ...\n" $0 echo "options:" echo "\t-a # Enable audio (default: ${AUDIO:-disable})" echo "\t-b c|d # Boot from c=HD, d=CD (default: ${BOOTDEV})" echo "\t-c file # CDROM device (default: ${CDROMDEV})" echo "\t-d # Debug" echo "\t-f file # FD image (default: ${FDIMG})" echo "\t-h file # HD image (default: ${HDAIMG})" echo "\t-m megs # Memory size in megabytes (default: ${GUESTMEM})" echo "\t-t num # TAP FD (default: ${TAP_FD})" exit 2 ;; esac done if [ -n "${CDROMDEV}" ]; then CDROM="-cdrom ${CDROMDEV}" fi #priocntl -s -c IA $$ echo ${QEMU} echo ${AUDIO} echo ${NETWORK} echo ${HDAIMG} exec ${QEMU} \ ${NETWORK} -localtime \ -hda ${HDAIMG} \ -boot ${BOOTDEV} -m ${GUESTMEM} -kernel-kqemu #cat /etc/qemu-ifup #!/bin/ksh # /etc/qemu-if: QEMU''s TAP network setup script for Solaris # $1 = tap0, tap1, ... if [ -z "$1" ] then echo "Usage: $0 interface" exit 1 fi DEV=${1%%[0-9]} PPA=${1##*[a-z]} # # You are expected to use network addresses for # the guests some non-used network as it relates # to your host to setup the private network # between the HOST and the QEMU Guest # NETMASK="255.255.255.0" # # OS can be defined by the shell script that # sol_qemu_tap calls to initialize QEMU so you # can have predictable IP addresses for # the QEMU Guest (though you still have to set # them in the Guest) # case "${OS}" in s10) HOST_IP="192.168.1.25${PPA}" GUEST_IP="192.168.1.1${PPA}" ;; winxp) HOST_IP="192.168.2.250" GUEST_IP="192.168.2.10" ;; win2k3) HOST_IP="192.168.3.250" GUEST_IP="192.168.3.10" ;; *) HOST_IP="192.168.1.25${PPA}" GUEST_IP="192.168.1.1${PPA}" ;; esac #set -x echo $1 echo ${HOST_IP} /sbin/ifconfig $1 ${HOST_IP} destination ${GUEST_IP} netmask ${NETMASK} up exit $? When I run the QEMU,my solaris host configurated this: # ifconfig -a lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 bge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2 inet 192.168.1.250 netmask ffffff00 broadcast 192.168.1.255 ether 0:11:43:44:2:8e tap0: flags=1002851<UP,POINTOPOINT,RUNNING,MULTICAST,UNNUMBERED,IPv4> mtu 1500 index 6 inet 192.168.1.250 --> 192.168.1.10 netmask ffffff00 ether a:0:20:38:50:a9 And QEMU guest(windows 2003) use rtl8139 nic,I have configured guest in this: ip address:192.168.1.10 netmask:255.255.255.0 default gateway:192.168.1.250 But guest receive nothing. (2)When started qemu like this: /usr/local/bin/qemu -net nic,model=rtl8139 -net user -hda /export/home/stevens/windows/win2003/win2003.img -localtime -kernel-kqemu Now I set guest OS DHCP client,but guest can''t get any ip address. -- This message posted from opensolaris.org