Comment 23 for bug 50385

Revision history for this message
Matthew Nuzum (newz) wrote : Re: samba can't be launched by a normal user (qemu related)

I'm testing with hardy and am experiencing this same problem.

Through the development period the problem has changed slightly. At the moment, just after alpha6, the problem is that the guest and the host can't talk to each other.

Thanks Joe, your tip helped. Without the -p 139 then smbclient -L returns the output of wrong share.

Here's how I'm launching the guest:

    kvm -m 128 -boot c -hda testserver1.img -smb /home/matt/

My gest is Hardy JeOS. I install smbclient in the guest and run this command:

    smbclient -L 10.0.2.4 -p 139

And I get:

Receiving SMB: Server stopped responding
session request to 10.0.2.4 failed (Call returned zero bytes (EOF))
Receiving SMB: Server stopped responding
session request to 10 failed (Call returned zero bytes (EOF))
Receiving SMB: Server stopped responding
session request to *SMBSERVER failed (Call returned zero bytes (EOF))

Qemu/KVM apparently creates a temporary smb.conf file in /tmp. In my case it is at /tmp/qemu-smb.26658/smb.conf and the contents of the file are:

-- begin smb.conf --
[global]
private dir=/tmp/qemu-smb.26658
smb ports=0
socket address=127.0.0.1
pid directory=/tmp/qemu-smb.26658
lock directory=/tmp/qemu-smb.26658
log file=/tmp/qemu-smb.26658/log.smbd
smb passwd file=/tmp/qemu-smb.26658/smbpasswd
security = share
[qemu]
path=/home/matt/
read only=no
guest ok=yes

-- end smb.conf --

The only other file in that folder is the log file. The log file looks like this:

-- begin log.smbd --
[2008/03/10 15:33:38, 1] smbd/files.c:file_init(193)
  file_init: Information only: requested 10000 open files, 1004 are available.
[2008/03/10 15:33:38, 0] passdb/secrets.c:secrets_init(66)
  Failed to open /var/lib/samba/secrets.tdb
[2008/03/10 15:33:38, 0] lib/messages.c:message_init(132)
  ERROR: Failed to initialise messages database
[2008/03/10 15:33:38, 1] smbd/files.c:file_init(193)
  file_init: Information only: requested 10000 open files, 1004 are available.
[2008/03/10 15:33:38, 0] passdb/secrets.c:secrets_init(66)
  Failed to open /var/lib/samba/secrets.tdb
[2008/03/10 15:33:38, 0] lib/messages.c:message_init(132)
  ERROR: Failed to initialise messages database

-- end log.smbd --

When I try to use smbclient to browse the share using:
    $ smbclient -I 10.0.2.4 //smbserver/qemu

I get this output:
    Password: [I hit enter for blank password]
    Anonymous login successful
    Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.28]
    tree connect failed: NT_STATUS_BAD_NETWORK_NAME

There is another entry in the host's /tmp/qemu-smb.26658/log.smbd file matching the ones listed above.

**** NOTE ****
If I don't use the -p 139 option mentioned by Joe above then I also get a message on the host's /var/log/samba/log.{hostname} indicating that there is no share called qemu

    $ smbclient -I 10.0.2.4 //smbserver/qemu

-- begin /var/log/samba/log.webserver --
[2008/03/10 15:39:57, 0] param/loadparm.c:process_usershare_file(4582)
  process_usershare_file: stat of /var/lib/samba/usershares/qemu failed. No such file or directory
[2008/03/10 15:39:57, 0] smbd/service.c:make_connection(1191)
  webserver (127.0.0.1) couldn't find service qemu

-- end log.webserver --