Qemu-kvm: network access from host to guest

I need ssh and http access from my host (Arch) to the guest (other Linux). I've failed at setting up Tap networking as described in the wiki. I don't need to have the whole LAN access the guest, so is there another way the host can access the guest? Using the guest's IP of 10.0.2.15 doesn't work, but I'm hoping there is a way to do it.
Thanks.

Mr.Elendig wrote:Bridging is the best way todo it, so you should give us some more info on your atempt at it, so that we can help you fix it.
Ok, I've followed the instructions from the wiki.
One problem is that I'm on a laptop. eth0 is wireless and eth1 is wired. I chose to use eth1 since I thought it'd be easier to get working on one device before trying to make it work on both.
1. bridge and tun modules are loaded from rc.conf
2. In /etc/conf.d/bridges I have this:
bridge_br0="eth1"
BRIDGE_INTERFACES=(br0)
3. In /etc/rc.conf I changed my networking portion to this:
eth1="eth1 up"
br0="dhcp"
INTERFACES=(eth1 br0)
4. In /etc/udev/rules.d/65-kvm.rules I have this:
KERNEL=="tun", NAME="net/%k", GROUP="kvm", MODE="0660"
5. My user is part of the kvm group, although I have also tried running qemu-kvm as root.
6. In /etc/qemu-ifup I put:
#!/bin/sh
echo "Executing /etc/qemu-ifup"
echo "Bringing up $1 for bridged mode..."
sudo /sbin/ifconfig $1 0.0.0.0 promisc up
echo "Adding $1 to br0..."
sudo /usr/sbin/brctl addif br0 $1
sleep 2
7. Using visudo I added this to the bottom:
Cmnd_Alias QEMU=/sbin/ifconfig,/sbin/modprobe,/usr/sbin/brctl,/usr/bin/tunctl
%kvm ALL=NOPASSWD: QEMU
8. I launch qemu-kvm with the following script:
USERID=`whoami`
IFACE=`sudo tunctl -b -u $USERID`
qemu-kvm -net nic -net tap,ifname="$IFACE" -vga std -m 1024 -k en-us -usbdevice tablet -localtime /dev/sda
sudo tunctl -d $IFACE &> /dev/null
My system starts with br0 getting the dhcp IP on boot, so that part is working.
When I run the qemu-kvm start script I get this error (running as user or root):
/etc/qemu-ifup: could not launch network script
Could not initialize device 'tap'
/etc/qemu-ifup is executable
Last edited by shakin (2009-06-05 19:13:14)

Similar Messages

  • WIN2008R2: No external network access from Hyper-V guest using Virtual Machine Bus - Legacy ok

    Windows Server 2008 R2 Enterprise x64 Hyper-V host
    HP DL370 G6, HP NC375i integrated Quad Port Multifunction Gigabit Server Adapter
    Static IP (.11), internet connection via a Cisco switch and PIX firewall
    External virtual network connected to port 1, allowing management OS to share the network adapter
    Windows Server 2008 R2 Enterprise x64 guest
    Static IP (.21) on the same subnet, same subnet mask and default gateway (.1) as host
    * with Virtual Machine Bus network adapter:
     - host can ping guest (.21), switch (.5), and has internet access
     - guest can ping host (.11), but cannot ping switch (.5) and has no internet access. 
     - network map shows the guest and host connected via a hub (Microsoft virtual switch), connected to a gateway, then a red X between gateway and internet
    * with Legacy network adapter:
     - host can ping guest (.21), switch (.5), and has internet access
     - guest can ping host (.11), switch (.5) and has internet access. 
     - network map shows the guest and host connected via a hub (Microsoft virtual switch), connected to a gateway, and no red X between gateway and internet
    I installed Hyper-V before adding the HP network drivers (there's a known problem if you install Hyper-V after adding the network drivers), so that's not it.
    This happens both with straight network adapters, and also when two are configured as a network team - no difference.
    I don't want to use the Legacy network adapter as the performance is terrible, but right now I have no choice as otherwise I can't get network or internet access from the guest. 
    Any ideas?

    Hi,
    Please refer to the following post to see whether you can resolve the issue.
    Network Adapter (not Legacy) does not work on Virtual Machine after installation through ISO
    http://social.technet.microsoft.com/Forums/en-US/windowsserver2008r2virtualization/thread/b1e9d24c-e298-472e-ad72-90cf079f6fbd
    By the way, did you only encounter this issue with one VM or all VMs? Please do the same test on VMs with other version of Windows such as Windows Server 2008 or Windows Server 2003.
    Best Regards,
    Vincent Hu

  • Cannot ping for either from host to guest nor from guest to host

    Hi I have installed virtual box 4.1.20 r80170
    my host os is centos 6.3 64 bit
    my guest os is oracle linux 5.8 64 bit
    I've using bridge adapter for the network settings, but I'm neither able to ping
    from host to guest
    from guest to host
    may I know what's wrong?
    how should I trouble shoot this?
    my host os network configurations is as follow:
    [oracle@localhost ~]$ /sbin/ifconfig
    eth0 Link encap:Ethernet HWaddr E8:E0:B7:D2:F9:54
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
    Interrupt:20 Memory:c4800000-c4820000
    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:3488 errors:0 dropped:0 overruns:0 frame:0
    TX packets:3488 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:320590 (313.0 KiB) TX bytes:320590 (313.0 KiB)
    wlan0 Link encap:Ethernet HWaddr 9C:B7:0D:96:F4:DF
    inet addr:192.168.0.199 Bcast:192.168.0.255 Mask:255.255.255.0
    inet6 addr: fe80::9eb7:dff:fe96:f4df/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:22932 errors:0 dropped:0 overruns:0 frame:0
    TX packets:22068 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:15525818 (14.8 MiB) TX bytes:5127595 (4.8 MiB)
    I'm using wlan0 on the host os
    my eth0 configurations on the guest os is as follow:
    #Intel Corporation 82540EM Gigabit Ethernet Controller
    DEVICE=etho0
    BOOTPROTO=static
    HWADDR:08:00:27:08:19:50
    ONBOOT:yes
    DHCPHOSTNAME=source.localdomain
    IPADDR=192.168.0.11
    NETMASK-192.168.0.1
    TYPE=Ethernet
    USERCTRL=no
    IPV6INIT=no
    PEERDNS=yes
    I've a router to connect to the Internet. It is dlink DIR-615
    I've done a dmesg while pinging from guest to host here's the partial output:
    spurious NAK ON isa0060/serio0
    some program might be trying to acces hardware directly
    e100:eth0 NIC link is up 1000 Mbp
    Full Duplex, Flow Control: RX
    ADDRCONF (NETDEV_UP) eth0: link is not ready
    ADDRCONF (NETDEV_CHANGE): eth0 becomes ready
    eth0: no IPv6 routes present
    Any assistance is deeply appreciated!
    thanks a lot!
    Edited by: oraclewannabe2 on Aug 25, 2012 11:28 AM
    Edited by: oraclewannabe2 on Aug 25, 2012 12:10 PM

    Hi ,
    This is OL 6.
    Now,after doing guestadditions this is working fine altough I am not sure what exactly guest addition is.
    Additionally,I installed firefox in same VM but when I click on firefox then nothing comes up.
    Best regards,
    Vishal

  • We have created shared folder on multiple client machine in domain environment on different 2 OS like-XP,Vista, etc. from some day's When we facing problem when we are access from host name that shared folder is accessible but same time same computer when

    Hello All,
    we have created shared folder on multiple client machine in domain environment on different 2 OS like-XP,Vista, etc.
    from some day's When we facing problem when we are access from host name that shared folder is accessible but same time same computer when we are trying to access the share folder with IP it asking for credentials i have type again and again
    correct credential but unable to access that. If i re-share the folder then we are access it but when we are restarted the system then same problem is occurring.
    I have checked IP,DNS,Gateway and more each & everything is well.
    Pls suggest us.
    Pankaj Kumar

    Hi,
    According to your description, my understanding is that the same shared folder can be accessed by name, but can’t be accessed be IP address and asks for credentials.
    Please try to enable the option below on the device which has shared folder:
    Besides, check the Advanced Shring settings of shared folder and confrim that if there is any limitation settings.
    Best Regards,
    Eve Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Virtual Machine( VM WARE) using Windows Server 2008 R2- how to install a software from host to guest.

    Dear All,
    Can you Please tell how to install a software SQL Server 2012 from the Host to my Guest OS Windows Server 2008R2 in my Virtual Machine? I am using VMPlayer and have already created a VM using the Windows Server 2008R2.
    I just need help in installing another software (SQLServer2012) from my laptop(guest computer) to my host VM. I also have the files downloaded into my C drive of my laptop(hostcomputer) for the SQL Server 2012. But I am lost as to where to click to install
    this software to my VM.
    I know I put into  Windows Server 2012 forum but I thin the procedure should be similar.
    Thank-you

    there are few options,
    you can copy the files from your host to virtual machine
    you can create a iso file and mount it to vm
    you can share the source files and access as a share
    Darshana Jayathilake

  • No external network access from virtual machine

    Hello:
    I'm configuring a Windows Server 2012 Standard with Hyper-V and want to share a network card so that both the virtual machine and the host access a LAN using the same wire.
    HOST SYSTEM:
    OS: Windows Server 2012 Standard
    IP: 192.168.50.1
    VIRTUAL MACHINE: Windows XP
    IP: 192.168.50.4
    PHYSICAL SWITCH (CISCO):
    IP: 192.168.50.6
    I've configured an external virtual switch, assigned to it a physical card and activated the sharing between host and virtual machine.
    With this configuration:
    ping from HOST to VM and viceversa: OK
    ping from HOST to REAL SWITCH: OK
    ping from VM to REAL SWITCH: FAIL
    If I configure the network card to work exclusively with the VM, it can access the external switch from the VM, but I lose any connection with the host.
    I could solve the problem installing another physical card and using one for the host and one for the VM, but I can't get both working with the same card, even though they are in the same subnet, see each other, share files between VM and host... I'm not
    trying to connect to the internet.
    Any idea? Thanks.

    Hello again,
    Sorry for the delay.
    After system update, the problem has not been solved. The external switches do not limit the number of MACs, so this is not the problem either.
    After updating the system I deleted the virtual switch and created it again. I also rebooted the VM and even the server. It just doesn't share the access: only the VM or the server can access to the net at the same time, even if both see each other all the
    time (server and VM).
    Apart from that, every time I delete the virtual switch and create a new one, I reconfigure the VM as well (I delete the network card at the VM and create it again). When I do that I have to assign an IP address to the network card in the VM (no DHCP
    installed, so this is normal), but I can use the same IP I was using before deleting the virtual switch. When I do so, a message appears saying the IP is used in a virtual network adapter, but this is hidden because it is not in use anymore. I haven't found
    a way to see and delete these hidden network adapters either.
    I think I'll install VMWare, because Hyper-V is more a problem than a solution.

  • MD3000 - Change Access From Host to Host-Group

    I've got a Hyper-V partition on an MD3000 called "HyperV-CSV".
    At present, in the "Host-to-Virtual Disk Mappings" it is only accessible by "Host HyperV1".
    I'm trying to allow host HyperV2 access as well, and without causing problems.  What I have done is created a Host Group called "HyperV-Group" where both HyperV1 and HyperV2 are members.
    So what I think I need to do is change the access of the Virtual Disk from "Host HyperV1" to "Host Group HyperV-Group".
    My questions though - will this disconnect the disk from HyperV1 briefly while making the change? Will this properly allow both HyperV1 and HyperV2 to access this virtual disk?
    This topic first appeared in the Spiceworks Community

    Hi AlexMtl,
    It seems the host accesses internet via wifi ,right ?
    The host still can access internet after removing bridge connection then reboot , right ?
    If it is the case , please refer to following setps :
    1. remove bridge from wifi then reboot it to ensure host can access internet
    2. create a new internal virtual switch
    3. share wifi connection  to the new Vswitch (right click wifi connection --> properties --> sharing --> check "allow another network ..."  and select the new internal Vswitch in the drop list)
    4. configure an IP for the new Vswitch same subnet as VM's IP
    5. configure VM's gateway same as the IP of new Vswitch (also configure the DNS server IP for VMs)
    Hope this helps
    Best Regards
    Elton Ji
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Network access from VM

    Hello,
    I have imported a 2.x VM to a 3.0.3 server, using 3.1.1 manager as a template. I removed network entries from the vm.cfg file before the import. Now I need to configure this VM to have network access, but I'm having a hard time putting all the different pieces together.
    What is the procedure to do this? I am going through the user's guide, but any other sources are much appreciated.
    Thanks.

    Well i was used to using VM Server 2.1.1 without the Manager, which I found too buggy to use and grew accustomed to just using the server itself. Now I went for VM Server 3.0.3 to check out the new manager which looks promising :-)
    I figured out my network issues so I'll mark this thread as answered, thanks.
    My problem was very very simple, no bond mapped to a network :-D I couldn't figure it out for a while, because I was trying to create a new network and that, of course, couldn't assign the already assigned bond. I was shocked how many people blog about Oracle VM installation only posting screenshots and text output of the actual installation, just seems pointless.
    The official User Manual is a great resource, but it's a bit harder to read for someone who only needs the simplest network to manage sandbox environments. I'm also using separate servers, each having their own (internal) repository and individual network.

  • Denying access from hosts other than localhost

    I would like to prohibit access to Directory Server from hosts other than the localhost:
    I am doing this from Administration Console. On the server node I set the ACI:
    (targetattr = "*")(version 3.0; acl "deny_ip"; deny (all) ip!=dirservhost_ip or ip!=127.0.0.1; )
    But the access is still allowed. What is wrong?

    Purchase a device like this. They are offered by many cellular carriers
    Verizon Wireless - Mobile Broadband -

  • Setting Network access from JInitiator Control Panel 1.1.8.3

    We were trying to use the GetClientInfo JavaBean from the Oracle Technology Network to read the clients IP address from the Web server. We were able to do this by setting the Network access to Unrestricted on the JInitiator Control Panel 1.1.8.3.
    Is it possible to get this to work without setting the Network access to Unrestricted?
    Also, does anybody know of any security concerns with setting the network access to Unrestricted?
    Thanks in Advance,
    Todd

    Hey Todd - I've been able to get the ip address without setting it to unrestricted.
    I can't tell you why you site requires this.
    Could you let me know what you learn?
    Mick

  • Qemu tap networking method from wiki

    The method described in the wiki for tap networking wouldn't work for me unless I ran run-qemu with sudo. I found another method using -net bridge rather than -net tap which seems simpler and more powerful and does not require root. I put an entry in the wiki describing how I did it.
    I'm kind of suspicious since it seems to be superior to the other method, which seems to be prevalent all over the web. I'm hoping a few people would be willing to give it a test. It's also my first substantial wiki edit, so advice/criticism in that regard would be welcomed.

    Maybe I didn't explain myself clearly, what I meant is that the setup of the bridges or the vde switch requires root, but using them can be done as a normal user, so in that regard they are similar.
    On another note I was curious about performance, and as I suspected, using a bridge is faster. I did a few tests with iperf and I got something like this:
    Using vde2 (-net nic,model=virtio -net vde):
    - iperf running as server on the guest
    -- unidirectional test: 301Mbit/s
    -- bidirectional test : 136Mbit/s + 239MBit/s
    - iperf running as server on the host
    -- unidirectional test: 338Mbit/s
    -- bidirectional test : 237Mbit/s + 135MBit/s
    Using the bridge (-net nic,model=virtio -net bridge,br=virbr):
    - iperf running as server on the guest
    -- unidirectional test: 500Mbit/s
    -- bidirectional test : 250Mbit/s + 248MBit/s
    - iperf running as server on the host
    -- unidirectional test: 544Mbit/s
    -- bidirectional test : 251Mbit/s + 266MBit/s
    Edit:
    I'm now a happy user of the method you suggested
    Last edited by R00KIE (2013-03-22 22:29:04)

  • Network access from local zones on a Solaris 10 router

    I'm kind of stuck at an interesting problem.
    I have a Solaris 10u6 system which is itself a router between a number of networks.
    It has several dozen routes to different networks via different next-hop gateways,
    just one of which is a default route to the ISP to internet.
    I thought of setting up local zones to securely run infrastructure services (BIND,
    Squid, Mail relay) on this machine, with only a single dedicated public IP address
    (from our delegated address space) per such zone. Zones use a shared-IP stack
    on one of the machine's VLAN interfaces (the LAN part with public IP addresses).
    The problem is - since this machine is the gateway for the subnet used for the
    local zones, they don't inherit any default route. The one default we have to the
    ISP is on another interface's subnet.
    [root@ns8 /]# netstat -rn | grep default
    [root@ns8 /]# netstat -rn | wc -l
    50
    On a side note, these zones do inherit dozens of other routes (50 above) with
    next-hop routers not on the local zone's subnet - so these are also not accessible.
    I think such useless routes should also be filtered away - as "mismatching" default
    routes are.
    Due to all this the zone has no networking outside its subnet/mask: it doesn't
    even try to send anything, since there is not a single route with a matching next
    hop router, i.e.
    [root@ns8 /]# traceroute -nI 194.87.0.50
    traceroute to 194.87.0.50 (194.87.0.50), 30 hops max, 40 byte packets
    1 xx.yy.zz.8 0.102 ms !H 0.032 ms !H 0.027 ms !H
    To reiterate, this setup is different from that of the numerous replays of "How to
    set up internet for zones with virtual IP addresses?"
    That recipe suggests to add a fake router and maintain its ARP address to be
    that of the real default gateway, and set up NAT to rewrite private IP addresses
    to the global zone's public IP. While I've also used the recipe a number of times,
    it does not seem feasible in this router's case - there are too many next-hop
    routers (and learned with a dynamic routing protocol), not just one default-gw.
    I can of course go back to running services in the global zone and binding them
    to these dedicated public IP addresses via configuration files - and this works
    since the global zone has access to any needed routers having IP addresses
    in relevant subnets - but I hoped to secure the system a bit more and separate
    routing from infrastructure tasks...
    So the question is: how can I set up networking for local zones in this case
    when they are running on a router? Is it possible?
    Thanks,
    //Jim

    You can set the Airport Extreme in "Bridge" mode, and then it will just extend the existing subnet.
    Airport Utility -> Airport Extreme -> Internet -> Connection Sharing -> Off (bridge mode)

  • Network Access from Work

    I'm at work on a PC and need to access my home Mac network. I've clicked on all the sharing properties on my Mac including the remote tab. What do I need to do on my PC in order to access the computer?

    First thing I would do is pay a visit to http://www.ifelix.net/tech/ and see if they have the necessary tech notes that you need that discuss your home Mac and work PC architectures. Be advised that these notes only discuss computers on the same LAN; you would have to modify whatever guidance is given there to accommodate the fact that you would be connecting over the wide-area, not just over the LAN. I don't know what would be required in way of modification with regards to PC because I am both Mac at work and home. I do know, however, that you will have had to set up port forwarding on your home router so this "uninvited/unexpected" traffic from you at work is permitted to pass through your home router's firewall. Frankly, I would not allow SMB connections or FTP connections directly over the internet. I don't know if Windows OS has built-in ssh like Mac OS or not. If not, you could install a 3rd-party ssh client for the work PC. I know our work used to suggest one for PC users called sshputty, at least a few years ago they did. Then you could use scp (secure copy) or sftp (secure ftp) from the command line, and have encrypted login and file transfer. Sorry, I can't give you any more guidance than that.

  • No video or network access from a PXI-8106

    I have a PXI-8106 embedded processor in a 1052 combo chassis running Windows XP. Up until about a week ago it was working fine. Now I can't get a video signal to a monitor or any network connection. The system administrator says it doesn't show up on the network at all and there is a link light and activity showing on the network port. Help!!! Do I need to buy a new processor?

    Hi stro1rob,
    Can you please verify the LED's on the front panel of the chassis when you have the controller powered on? 
    The POWER OK LED indicates the power status of the controller and will either be ON and steady, blinking, or OFF. The DRIVE LED indicates when an access to the internal hard disk is occurring. 
    Try hooking up another DVI monitor (that is known to work) to your chassis. There could be a number of things going on right now, so we should try isolating the problem. I'm assuming that you are also connected to your network via the Ethernet port, so I would try connecting again with another cable.
    Here is a KB that discusses a BIOS issue that can cause your video output to disappear, but since you have mentioned that your setup originally worked, I doubt this is the case, but it might still be worth looking at.
    If the above mentioned things do not work out, you would probably need to get your controller RMA'ed. To do so, please call into NI Support.
    Jason L.
    Product Support Engineer
    National Instruments

  • Home network access from Iphone 4S

    I have a new Ipone 4S.  It recognises my home network but I get error message " Unable to join the network".   When viewing networks mine has the small padlock beside it.   It does not ask for a password?   Any ideas please...   Jeff

    Hi Jeff
    First of all try this
    Unplug the modem,
    wait 30 seconds,
    plug it back in,
    go to the iPhone settings and select general and then network settings and Reset the network settings,
    Restart the iPhone and try to connect again, putting in your password when asked
    If this does not work then we'll need some more information like
    1) What else uses your home network?
    2) What encryption do you have 64 bit / 128 bit etc
    3) What have you tried (for ruling out purposes)
    4) What router do you have?
    5) Go to iphone settings, wi-fi, select the blue arrow next to your network, what does each section say?
    Thanks
    Craig

Maybe you are looking for