You are not logged in.

#1 2022-02-22 09:01:02

Mainframed1
Member
Registered: 2020-08-17
Posts: 6

Qemu's bultin Samba server not starting (or keeping alive)

Dear Arch Linux Community,

Intro & Goal

I'm trying to set up a Samba share on my host and make it available to a QEMU Windows 10 Guest.

My setup

I've followed the explanation here: https://wiki.archlinux.org/title/QEMU#QEMU's_built-in_SMB_server multiple times without success.

My QEMU current configuration is:

qemu-system-x86_64 \
    -drive file=${SCRIPT_DIR}/cdrive.raw,format=raw \
    -m 4G -smp 4 \
    -enable-kvm \
    -machine q35 -device intel-iommu \
    -vga vmware -usb -device usb-tablet \
    -audiodev pa,id=snd0 \
    -net user,smb=${SCRIPT_DIR}/shared/ \
    -net nic,model=virtio \
    -cpu host,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time \
    -device virtio-serial-pci \
    -spice unix,addr=/tmp/vm_spice.socket,disable-ticketing \
    -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \
    -chardev spicevmc,id=spicechannel0,name=vdagent

I've also tried the same without the virtio network driver and received the same result.

Observed output

I observe following:

  1. Internet access in Guest works

  2. When booting a folder named /tmp/qemu-smb.{random_hex} with the file smb.conf inside it is created with the following content:

    [global]
    private dir=/tmp/qemu-smb.N5QXH1
    interfaces=127.0.0.1
    bind interfaces only=yes
    pid directory=/tmp/qemu-smb.N5QXH1
    lock directory=/tmp/qemu-smb.N5QXH1
    state directory=/tmp/qemu-smb.N5QXH1
    cache directory=/tmp/qemu-smb.N5QXH1
    ncalrpc dir=/tmp/qemu-smb.N5QXH1/ncalrpc
    log file=/tmp/qemu-smb.N5QXH1/log.smbd
    smb passwd file=/tmp/qemu-smb.N5QXH1/smbpasswd
    security = user
    map to guest = Bad User
    load printers = no
    printing = bsd
    disable spoolss = yes
    usershare max shares = 0
    [qemu]
    path=/home/lucas/Qemu/windoof/shared/
    read only=no
    guest ok=yes
    force user=lucas

  3. But no smb server is started automatically. (and hence no further files are created)

  4. When I open the "Networking"-tab in the Windows file manager, it appears that a Samba server on the host is started

  5. But I think it dies quickly. Atleast I cannot find a samba server using ps aux | grep smbd 

  6. More files are generated in the /tmp/qemu-smb.{random_hex} folder, including a log file, which says:

    [2022/02/22 09:30:57.238444,  0] ../../source3/smbd/server.c:1734(main)
      smbd version 4.15.5 started.
      Copyright Andrew Tridgell and the Samba Team 1992-2021
    [2022/02/22 09:30:57.248798,  0] ../../lib/util/become_daemon.c:150(daemon_status)
      daemon_status: daemon 'smbd' : Starting process ...
    [2022/02/22 09:30:57.302946,  0] ../../lib/util/pidfile.c:235(pidfile_unlink)
      Failed to delete pidfile /tmp/qemu-smb.N5QXH1/smbd.pid. Error was Datei oder Verzeichnis nicht gefunden
    [2022/02/22 09:30:57.392311,  0] ../../source3/smbd/server.c:1734(main)
      smbd version 4.15.5 started.
      Copyright Andrew Tridgell and the Samba Team 1992-2021
    [2022/02/22 09:30:57.395350,  0] ../../lib/util/become_daemon.c:150(daemon_status)
      daemon_status: daemon 'smbd' : Starting process ...
    [2022/02/22 09:30:57.413161,  0] ../../lib/util/pidfile.c:235(pidfile_unlink)
      Failed to delete pidfile /tmp/qemu-smb.N5QXH1/smbd.pid. Error was Datei oder Verzeichnis nicht gefunden
    [2022/02/22 09:30:57.492308,  0] ../../source3/smbd/server.c:1734(main)
      smbd version 4.15.5 started.
      Copyright Andrew Tridgell and the Samba Team 1992-2021
    [2022/02/22 09:30:57.494622,  0] ../../lib/util/become_daemon.c:150(daemon_status)
      daemon_status: daemon 'smbd' : Starting process ...
    [2022/02/22 09:30:57.510263,  0] ../../lib/util/pidfile.c:235(pidfile_unlink)
      Failed to delete pidfile /tmp/qemu-smb.N5QXH1/smbd.pid. Error was Datei oder Verzeichnis nicht gefunden
    [2022/02/22 09:30:57.711890,  0] ../../source3/smbd/server.c:1734(main)
      smbd version 4.15.5 started.
      Copyright Andrew Tridgell and the Samba Team 1992-2021
    [2022/02/22 09:30:57.714935,  0] ../../lib/util/become_daemon.c:150(daemon_status)
      daemon_status: daemon 'smbd' : Starting process ...
    [2022/02/22 09:30:57.734550,  0] ../../lib/util/pidfile.c:235(pidfile_unlink)
      Failed to delete pidfile /tmp/qemu-smb.N5QXH1/smbd.pid. Error was Datei oder Verzeichnis nicht gefunden
    [2022/02/22 09:30:57.807657,  0] ../../source3/smbd/server.c:1734(main)
      smbd version 4.15.5 started.
      Copyright Andrew Tridgell and the Samba Team 1992-2021
    [2022/02/22 09:30:57.809832,  0] ../../lib/util/become_daemon.c:150(daemon_status)
      daemon_status: daemon 'smbd' : Starting process ...
    [2022/02/22 09:30:57.823587,  0] ../../lib/util/pidfile.c:235(pidfile_unlink)
      Failed to delete pidfile /tmp/qemu-smb.N5QXH1/smbd.pid. Error was Datei oder Verzeichnis nicht gefunden
    [2022/02/22 09:30:57.887176,  0] ../../source3/smbd/server.c:1734(main)
      smbd version 4.15.5 started.
      Copyright Andrew Tridgell and the Samba Team 1992-2021
    [2022/02/22 09:30:57.889418,  0] ../../lib/util/become_daemon.c:150(daemon_status)
      daemon_status: daemon 'smbd' : Starting process ...
    [2022/02/22 09:30:57.902730,  0] ../../lib/util/pidfile.c:235(pidfile_unlink)
      Failed to delete pidfile /tmp/qemu-smb.N5QXH1/smbd.pid. Error was Datei oder Verzeichnis nicht gefunden
    [2022/02/22 09:30:57.966528,  0] ../../source3/smbd/server.c:1734(main)
      smbd version 4.15.5 started.
      Copyright Andrew Tridgell and the Samba Team 1992-2021
    [2022/02/22 09:30:57.968934,  0] ../../lib/util/become_daemon.c:150(daemon_status)
      daemon_status: daemon 'smbd' : Starting process ...
    [2022/02/22 09:30:57.982583,  0] ../../lib/util/pidfile.c:235(pidfile_unlink)
      Failed to delete pidfile /tmp/qemu-smb.N5QXH1/smbd.pid. Error was Datei oder Verzeichnis nicht gefunden
    [2022/02/22 09:30:58.043314,  0] ../../source3/smbd/server.c:1734(main)
      smbd version 4.15.5 started.
      Copyright Andrew Tridgell and the Samba Team 1992-2021
    [2022/02/22 09:30:58.045357,  0] ../../lib/util/become_daemon.c:150(daemon_status)
      daemon_status: daemon 'smbd' : Starting process ...
    [2022/02/22 09:30:58.058017,  0] ../../lib/util/pidfile.c:235(pidfile_unlink)
      Failed to delete pidfile /tmp/qemu-smb.N5QXH1/smbd.pid. Error was Datei oder Verzeichnis nicht gefunden
    [2022/02/22 09:30:58.118585,  0] ../../source3/smbd/server.c:1734(main)
      smbd version 4.15.5 started.
      Copyright Andrew Tridgell and the Samba Team 1992-2021
    [2022/02/22 09:30:58.120652,  0] ../../lib/util/become_daemon.c:150(daemon_status)
      daemon_status: daemon 'smbd' : Starting process ...
    [2022/02/22 09:30:58.132547,  0] ../../lib/util/pidfile.c:235(pidfile_unlink)
      Failed to delete pidfile /tmp/qemu-smb.N5QXH1/smbd.pid. Error was Datei oder Verzeichnis nicht gefunden
    [2022/02/22 09:30:58.195797,  0] ../../source3/smbd/server.c:1734(main)
      smbd version 4.15.5 started.
      Copyright Andrew Tridgell and the Samba Team 1992-2021
    [2022/02/22 09:30:58.198061,  0] ../../lib/util/become_daemon.c:150(daemon_status)
      daemon_status: daemon 'smbd' : Starting process ...
    [2022/02/22 09:30:58.210032,  0] ../../lib/util/pidfile.c:235(pidfile_unlink)
      Failed to delete pidfile /tmp/qemu-smb.N5QXH1/smbd.pid. Error was Datei oder Verzeichnis nicht gefunden
    [2022/02/22 09:30:58.267852,  0] ../../source3/smbd/server.c:1734(main)
      smbd version 4.15.5 started.
      Copyright Andrew Tridgell and the Samba Team 1992-2021
    [2022/02/22 09:30:58.269900,  0] ../../lib/util/become_daemon.c:150(daemon_status)
      daemon_status: daemon 'smbd' : Starting process ...
    [2022/02/22 09:30:58.281466,  0] ../../lib/util/pidfile.c:235(pidfile_unlink)
      Failed to delete pidfile /tmp/qemu-smb.N5QXH1/smbd.pid. Error was Datei oder Verzeichnis nicht gefunden

    Translation: the smbd.pid file does not exist

Question

Does someone have an idea why my samba daemon does not start successfully?

I would appreciate any inputs.
Thank you in advance.

Offline

Board footer

Powered by FluxBB