You are not logged in.

#1 2017-07-08 01:55:00

i716
Member
From: Yokohama, Japan
Registered: 2016-04-18
Posts: 70

[SOLVED] Networking KVM/QEMU Host-Guest

I recently virtualized Windows 7 with KVM/QEMU and after all virtio and spice drivers are installed, it is actually running very smooth. Unfortunately, I am unable to establish a network connection between the host OS (Arch) and the guest OS (Win7) - Ping fails in both directions. I do however want to share files between these machines using Samba. And yes, I know that I can exchange files via drag and drop over Spice (it works well) but that's not what I am looking for.

So I have read about this on the internet and I have tried to approach the issue in two ways:

1) Using virsh:

 sudo virsh iface-bridge eno1 br0 

which reports the following error back:

error: failed to get interface 'eno1'
error: Interface not found: couldn't find interface named 'eno1'

Also creating a netctl profile for the above local connection in /etc/netctl doesn't rectify this.


2) By manually creating a bridge using this script:

 
#!/bin/bash
sudo ip link set eno1 down
sudo ip link set eno1 up
sudo brctl addbr br0
sudo brctl addif br0 eno1
sudo ip link set up dev br0

The newly created bridge will show up on ip link show but is otherwise useless. Likewise, the spice server will complain that it can't connect to local host when trying to boot the guest with the br0 interface.

Does anybody have an idea on how to establish a working network connection between the host OS and the guest OS?
Thanks in advance.

UPDATE: I have created a bridge via netctl (br0) and it can be used to boot the VM. The VM can also now be pinged from the Host (Arch), and the Host can be pinged from the guest.
But I still can't see the Shared folder from the Host...

 user1  ~  smbclient -L 192.168.10.6
Enter WORKGROUP\user1's password: 
Domain=[KVMQEMU-WIN7PRO] OS=[] Server=[]

    Sharename       Type      Comment
    ---------       ----      -------
    ADMIN$          Disk      Remote Admin
    C$              Disk      Default share
    IPC$            IPC       Remote IPC
    Users           Disk      
Connection to 192.168.10.6 failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)
NetBIOS over TCP disabled -- no workgroup available

Installing gvfs-smb allows me to access the Guest (not just the folder I shared but all files ??) if I enter my username and password. That is extremely strange but at least it allows me to get access to my files for now.

Last edited by i716 (2017-07-13 09:06:27)

Offline

#2 2017-07-13 06:58:25

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: [SOLVED] Networking KVM/QEMU Host-Guest

How do you start win7 with qemu, using this bridge?

Offline

#3 2017-07-13 07:13:41

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: [SOLVED] Networking KVM/QEMU Host-Guest

What's the username your entered when you access it with your file manager (via gvfs-smb)? Is it user1?

Check out -U|--user=username[%password]: https://www.samba.org/samba/docs/man/ma … ent.1.html

Offline

#4 2017-07-13 08:02:48

i716
Member
From: Yokohama, Japan
Registered: 2016-04-18
Posts: 70

Re: [SOLVED] Networking KVM/QEMU Host-Guest

@ Docbroke: Yes, I set br0 as the network interface in virt-manager.

@ tom.ty89: On both the host and the guest the default user is user1. Sambauser is also user1.

If accessing the shares on the host, everything is fine and I only get to see what is defined in the samba config file. But if I try to access the Win7 machine from the host, it will ask for my login and password and then it will let me access the whole C drive.

Offline

#5 2017-07-13 08:17:35

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: [SOLVED] Networking KVM/QEMU Host-Guest

I wonder if these are relevant:

smbclient(1) wrote:

-L|--list
This option allows you to look at what services are available on a server. You use it as smbclient -L host and a list should appear. The -I option may be useful if your NetBIOS names don't match your TCP/IP DNS host names or if you are trying to reach a host on another network.

So perhaps you should try -L $NetBIOSName instead, or

smbclient(1) wrote:

-I|--ip-address IP-address
IP address is the address of the server to connect to. It should be specified in standard "a.b.c.d" notation.

Normally the client would attempt to locate a named SMB/CIFS server by looking it up via the NetBIOS name resolution mechanism described above in the name resolve order parameter above. Using this parameter will force the client to assume that the server is on the machine with the specified IP address and the NetBIOS name component of the resource being connected to will be ignored.

There is no default for this parameter. If not supplied, it will be determined automatically by the client as described above.

Edit: Also is WORKGROUP the actual workgroup name set in the guest?

Last edited by tom.ty89 (2017-07-13 08:25:29)

Offline

#6 2017-07-13 08:33:50

i716
Member
From: Yokohama, Japan
Registered: 2016-04-18
Posts: 70

Re: [SOLVED] Networking KVM/QEMU Host-Guest

@tom.ty89

The problem has to be on the Windows side. I have only shared one folder on it but it seems like it has shared the whole disk.
In Linux you can disable sharing your home directories in the samba.conf file - that's what I always do - and it works well.
But it seems that Windows is sharing the whole disk by default?

Anyways, to answer you question: Yes, WORKGROUP is the actual wg name. And here is the list of shared folders on the virtual machine:

[user1@T1700 ~]$ smbclient -L kvmqemu-win7pro
Enter WORKGROUP\user1's password: 
Domain=[KVMQEMU-WIN7PRO] OS=[] Server=[]

	Sharename       Type      Comment
	---------       ----      -------
	ADMIN$          Disk      Remote Admin
	C$              Disk      Default share
	IPC$            IPC       Remote IPC
	Users           Disk      
Domain=[KVMQEMU-WIN7PRO] OS=[] Server=[]

	Server               Comment
	---------            -------

	Workgroup            Master
	---------            -------
[user1@T1700 ~]$ 

Offline

#7 2017-07-13 08:55:36

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: [SOLVED] Networking KVM/QEMU Host-Guest

Is Users the folder you shared?

See these:
https://en.m.wikipedia.org/wiki/Adminis … cteristics
https://support.microsoft.com/en-us/hel … erver-2008

Perhaps you can also create a user for this purpose solely which has permission to access C: removed as well? Yeah I was merely trying to get rid of the errors you saw when you use IP address. The share/permission thing is really off-topic here when your server is Windows.

Offline

#8 2017-07-13 09:04:11

i716
Member
From: Yokohama, Japan
Registered: 2016-04-18
Posts: 70

Re: [SOLVED] Networking KVM/QEMU Host-Guest

Well, you are right. The Users folder was indeed shared. That would explain why the home directory was accessible. I don't know why this happened since I have only shared a folder called 'Shared' inside my home directory.
And regarding the C drive, it can be seen from the host but user1 can't connect to it. As expected.
I think we can mark this as solved now.

Offline

Board footer

Powered by FluxBB