AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 441147
Accepted
Dave
Dave
Asked: 2018-05-02 11:34:11 +0800 CST2018-05-02 11:34:11 +0800 CST 2018-05-02 11:34:11 +0800 CST

QEMU:将 Tails-VM 连接到主机上的 Samba 网络共享时出现问题

  • 772

我在 Debian 9 主机上的虚拟机中运行 Tails。为了通过 Tails 访问主机上的共享文件夹,我尝试设置 Samba-exchange。

虽然这种方法在 Debian 8 中运行良好,但在 Debian 9 中不再适用。尝试连接到 Samba 共享时,我总是收到以下错误:

"无法访问位置。无法从服务器检索共享列表:连接超时。 "


在QEMU-settings 中,我将网络源(虚拟网络接口)指定为带有 name 的网桥virbr0,设备型号为virtio. 运行机器时,桥接器被激活,物理网络接口也被激活,来宾(= Tails)接收互联网访问没有任何问题。只有Samba-share 不起作用。

我的/etc/samba/smb.conf样子是这样的:

[global]
workgroup = WORKGROUP
netbios name = MYCOMPUTER
name resolve order = bcast
dns proxy = no
log file = /var/log/samba/log./%m
max log size = 50
panic action = /usr/share/samba/panic-action %d
server role = standalone server
map to guest = bad user
usershare allow guests = yes
security = user
server string = %h server (Samba, Ubuntu)
bind interfaces only = yes
interfaces = enp0s25 virbr* lo

[Windows-SMB]
comment = Shared Samba Network Drive for Windows
path = /home/user/Public/Windows-Exchange
public = no
guest ok = no
browseable = yes
writeable = yes

[Tails-SMB]
comment = Shared Samba Network Drive for Tails
path = /home/user/Public/Tails-Exchange
public = no
guest ok = no
browseable = yes
writeable = yes

我尝试了所有可能的解决方案:

  • 安装包gvfs-bin

编辑/etc/samba/smb.conf:

  • 添加netbios name = NAME-OF-PC
  • 添加name resolve order = bcast host

然而,他们都没有工作。


我试图缩小错误的来源:

testparm未检测到任何错误,smbtree正确显示所有共享。如果我从中获取显示的 IP 地址nmblookup <hostname>并将其插入到 Tails 中,我会再次收到上述错误。

但是,从访客 ping Samba-share-IP 可以正常工作。我只是无法使用 Tails 文件浏览器访问共享。

我可以看看其他一些想法?

该命令smbclient -L host给我带来了“与主机的连接失败(错误 NT_STATUS_UNSUCCESSFUL) ”。但是,如果我键入,smbclient -L 192.168.178.31我会成功获得包含共享的表格。


以下是当前情况的一些截图:

通过 CLI 进行配置检查:

user@hostname: ~$ smbtree
WORKGROUP
   \\HOSTNAME                  HOSTNAME server (Samba, Ubuntu)
        \\HOSTNAME\IPC$             IPC Service (HOSTNAME server (Samba, Ubuntu))
        \\HOSTNAME\Tails-SMB        Shared Samba Network Drive for Tails
        \\HOSTNAME\Windows-SMB      Shared Samba Network Drive for Windows

user@hostname: ~$ nmblookup
192.168.122.1 HOSTNAME<00>

(This seems to be fine)

虚拟机管理器:

QEMU 虚拟管理器中的物理网络接口:enp0s25

QEMU 虚拟管理器中的物理网络接口:lo

Tails 应该使用的虚拟网桥“virbr0”

Gnome 网络管理器:

Gnome 网络管理器:

通过文件浏览器连接到 Samba 共享 IP 时出现 Tails 错误:

通过文件浏览器连接到 samba 共享时出现 Tails 错误

Tails(成功?)向 Samba-Server-IP 发送 ping:

因此,这两个 IP 似乎都可以正常工作:192.168.122.1以及192.168.178.31(从重新启动 samba 服务器之前的先前尝试)。

在 Tails 中 Ping 到 Samba 服务器


Update: Samba-exchange is still not working.

Maybe interesting: Very frustrated about this Samba-issue I reinstalled my Debian 9 host several times because I thought I did a mistake anyhow. Hereby I think to remember the following fact: The first time I installed Debian and wanted to start Virtual Machine Managers default network bridge virbr0 I got an error that no firewall has been detected. Therefore Virtual Machine Manager did not want to start this bridge. I never received such a warning before, so I deleted the default network bridge and recreated a new one with identical settings and the same name. However, manually starting this new bridge was easily possible without any problems. Although still no firewall has been installed Virtual Machine Manager accepted the new bridge without complains. I think to remember that this time I got the Samba-exchange working.

However, I did a whole reinstall of the host system because some other things did not work and I played a lot with packages in the meanwhile. Hereby I figured out that this error message "No Firewall has been detected" was caused by missing packages firewalld and dnsmasq. I installed those packages and never got Samba exchange working again.

Unfortunately I am not that much into Linux to figure out the mistake by myself. Maybe it is just an easy thing with IP-settings of the firewall or something like this...

Another stupid behavior of Samba is the fact that directly after restarting the Samba server by command /etc/init.d/samba restart the smbtree-command does not work straight ahead. I have to wait several seconds sometimes until I do not receive an empty line anymore and the tree is displayed.

Furthermore the smbtree command only shows one output line with the hostname sometimes, but without naming the created Samba shares. This behavior seems to be influenced by the options in smb.conf. The upper presented smb.conf invites smbtree-command to correctly show the shares in its output as well. However, if I do a very simple [global] section with only two basic entries, sometimes the output of smbtree remains completely empty - I don't know why.

On my Debian 8 host machine with identical settings the smbtree-command output indeed is only one line as well. Maybe there is a bug anywhere? Normally smbtree should show the host name and the Samba shares as well. At least the Samba exchange is working on this Debian 8 system (no firewalld and no dnsmasq are installed here).

debian samba
  • 2 2 个回答
  • 1141 Views

2 个回答

  • Voted
  1. D'Arcy Nader
    2018-05-02T22:11:28+08:002018-05-02T22:11:28+08:00

    you are using broadcast ( bcast ) to resolve the name but you have your machines on different subnet.

    broadcast name resolving only works on the same subnet.

    you must add an entry to your /etc/hosts on the tail host that says:

    192.168.178.31    hostnameofthesmbserver
    

    you can do that with this command:

    sudo nano /etc/hosts
    

    always check this file on reboot because i don't think tail will keep this change persistent.

    • 1
  2. Best Answer
    Dave
    2018-05-11T05:48:01+08:002018-05-11T05:48:01+08:00

    A colleague figured out the problem:

    默认情况下,Samba 被firewalld. 因此,必须安装软件包firewall-config以在防火墙中激活 Samba。可能这在没有 GUI 的情况下也是可能的,但firewall-config它是一个 10 秒的任务......提到在防火墙中激活 Samba 为永久的,不仅适用于当前会话。

    现在一切正常!

    • 0

相关问题

  • GRUB 配置以识别同一 Linux 发行版的不同桌面环境(安装)

  • astyle 不会更改源文件格式

  • 接收有关全新 Debian 的电子邮件

  • Debian Stretch:libgs_plugin_systemd-updates.so 中的 gnome-software 段错误

  • 如何在拼音输入法中输入ü?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    ssh 无法协商:“找不到匹配的密码”,正在拒绝 cbc

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    如何卸载内核模块“nvidia-drm”?

    • 13 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Wong Jia Hau ssh-add 返回:“连接代理时出错:没有这样的文件或目录” 2018-08-24 23:28:13 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST
  • Martin Hope
    Bagas Sanjaya 为什么 Linux 使用 LF 作为换行符? 2017-12-20 05:48:21 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve