Bug#378592: qemu -net user,smb=$HOME/tmp/foo fails with samba 2:3.6.6-2

July 17th, 2012 - 12:00 pm ET by Friedrich Delgado | Report spam
Package: qemu
Version: 1.1.0+dfsg-1
Followup-For: Bug #378592

Hi!

It appears that bug #249873 on the Samba package
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug$9873) was fixed,
however I still can't access samba shares from inside qemu guests.

The abridged qemu command line:

qemu-kvm -snapshot -drive file=moo.qcow2,if=virtio -net user,smb=$HOME/tmp/myshare,hostfwd=tcp:127.0.0.1:2022-:22 -net nic,model=virtio -m 2048 -nographic -serial mon:telnet::12345,server,nowait -cpu host -smp 2


syslog contains the following lines:

,-
Jul 17 17:33:42 orion smbd[23037]: [2012/07/17 17:33:42.551505, 0] passdb/secrets.c:76(secrets_init)
Jul 17 17:33:42 orion smbd[23037]: Failed to open /var/lib/samba/secrets.tdb
Jul 17 17:33:42 orion smbd[23037]: [2012/07/17 17:33:42.575910, 0] passdb/secrets.c:76(secrets_init)
Jul 17 17:33:42 orion smbd[23037]: Failed to open /var/lib/samba/secrets.tdb
Jul 17 17:33:42 orion smbd[23037]: [2012/07/17 17:33:42.576002, 0] smbd/server.c:1170(main)
Jul 17 17:33:42 orion smbd[23037]: ERROR: smbd can not open secrets.tdb
Jul 17 17:33:42 orion smbd[23043]: [2012/07/17 17:33:42.664919, 0] passdb/secrets.c:76(secrets_init)
Jul 17 17:33:42 orion smbd[23043]: Failed to open /var/lib/samba/secrets.tdb
Jul 17 17:33:42 orion smbd[23043]: [2012/07/17 17:33:42.665357, 0] passdb/secrets.c:76(secrets_init)
Jul 17 17:33:42 orion smbd[23043]: Failed to open /var/lib/samba/secrets.tdb
Jul 17 17:33:42 orion smbd[23043]: [2012/07/17 17:33:42.665462, 0] smbd/server.c:1170(main)
Jul 17 17:33:42 orion smbd[23043]: ERROR: smbd can not open secrets.tdb
Jul 17 17:33:42 orion smbd[23045]: [2012/07/17 17:33:42.724325, 0] passdb/secrets.c:76(secrets_init)
Jul 17 17:33:42 orion smbd[23045]: Failed to open /var/lib/samba/secrets.tdb
Jul 17 17:33:42 orion smbd[23045]: [2012/07/17 17:33:42.724644, 0] passdb/secrets.c:76(secrets_init)
Jul 17 17:33:42 orion smbd[23045]: Failed to open /var/lib/samba/secrets.tdb
Jul 17 17:33:42 orion smbd[23045]: [2012/07/17 17:33:42.724697, 0] smbd/server.c:1170(main)
Jul 17 17:33:42 orion smbd[23045]: ERROR: smbd can not open secrets.tdb
`-

Judging from log in the samba bug, it might have been fixed in a way
that is not conforming to qemu's expectations wrt to the expected
configuration. Most notably:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug$9873#165


Debian Release: wheezy/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (50, 'oneiric'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.4-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8) (ignored: LC_ALL set to de_DE.utf8)
Shell: /bin/sh linked to /bin/bash

Versions of packages qemu depends on:
ii qemu-system 1.1.0+dfsg-1
ii qemu-user 1.1.0+dfsg-1
ii qemu-utils 1.1.0+dfsg-1

qemu recommends no packages.

Versions of packages qemu suggests:
pn qemu-user-static <none>



To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
email Follow the discussionReplies 3 repliesReplies Make a reply

Replies

#1 Michael Tokarev
July 17th, 2012 - 03:20 pm ET | Report spam
On 17.07.2012 19:42, Friedrich Delgado wrote:
Package: qemu
Version: 1.1.0+dfsg-1
Followup-For: Bug #378592

Hi!

It appears that bug #249873 on the Samba package
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug$9873) was fixed,
however I still can't access samba shares from inside qemu guests.

The abridged qemu command line:

qemu-kvm -snapshot -drive file=moo.qcow2,if=virtio -net user,smb=$HOME/tmp/myshare,hostfwd=tcp:127.0.0.1:2022-:22 -net nic,model=virtio -m 2048 -nographic -serial mon:telnet::12345,server,nowait -cpu host -smp 2


syslog contains the following lines:

,-
Jul 17 17:33:42 orion smbd[23037]: [2012/07/17 17:33:42.551505, 0] passdb/secrets.c:76(secrets_init)
Jul 17 17:33:42 orion smbd[23037]: Failed to open /var/lib/samba/secrets.tdb
Jul 17 17:33:42 orion smbd[23037]: [2012/07/17 17:33:42.575910, 0] passdb/secrets.c:76(secrets_init)
Jul 17 17:33:42 orion smbd[23037]: Failed to open /var/lib/samba/secrets.tdb



Interesting. It works here - not "just fine", but works.

I replaced /usr/sbin/smbd with a tiny shell wrapper which runs
smbd.bin under strace -- the resulting trace does not have any
references to any "main" samba dirs (/var/lib/samba /var/run/samba
etc), only to the temporary directory (/tmp/qemu-smb.$pid/).

It is still not perfect, sometimes it breaks in other interesting
ways, and the behavour is not consistent, and adding strace into
the mix makes it to fail much more often than not, so I guess it
is due to some timing/races.

But here it definitely does not touch any regular samba files.

Except one: usershare directory, which is relatively new parameter.
When smbd tries to access it, the system returns EACCESS and smbd
terminates with fatal error. But it has nothing to do with the
issue you're reporting.

Are you sure that

a) the log you provided actually corresponds to the right samba?
Qemu puts "logfile = /tmp/qemu-smb../smb.log" directive into the
smb.conf file, so there should be no logging in syslog, and

b) you're using the right smbd binary?

Thanks,

/mjt


To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact

Similar topics