her*_*ron 13 server ssh virtualbox samba 12.10
我的操作系统:Windows 8
Virtualbox 来宾:Ubuntu 12.10 服务器
我在 vbox 来宾上配置了 apache 服务器并将 http、https、ssh 端口成功映射到 ubuntu 服务器。它运行良好,没有任何问题。
我的网卡是NAT模式。经过一番研究,我在来宾系统上安装了 samba。我需要在 Windows 8 上映射 /var/www/ 文件夹,以便我可以从 Windows 直接在来宾服务器内工作。
这是我的 smb.conf
[share]
comment = "Vbox server share"
path = /
writable = yes
read only =no
browseable = yes
force directory mode = 777
force create mode = 777
force security mode = 777
force directory security mode = 777
hide dot files = no
create mask = 0777
directory mask = 0777
valid users = @users, tural, root
delete readonly = yes
guest ok = yes
workgroup = WORKGROUP
Run Code Online (Sandbox Code Playgroud)
我知道映射在网络处于桥接模式时有效,但我不想让我的 vbox 服务器对网络可见。
此外,我配置了 windows 主机文件并使用 vbox nat 映射了端口 80,这样,当我打开一些重定向到 windows 上的 localhost 的域时,它会从 virtualbox webserver 获取数据。如果做桥接,我将无法打开访客网络服务器
有没有其他方法可以通过 NAT 或其他方式使驱动器映射成为可能?
仅将第二个适配器配置为主机,将 VM 上的第二个接口设置为不干扰本地网络的静态 ip,例如,将 /etc/network/interfaces 设置为:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
# The host network interface
#auto eth1
#iface eth1 inet dhcp
auto eth1
iface eth1 inet static
address 192.168.36.2
netmask 255.255.255.0
network 192.168.36.0
gateway 192.168.36.1
dns-nameservers 192.168.36.1
Run Code Online (Sandbox Code Playgroud)
然后从 Windows 网络转到其属性并设置一个不干扰本地网络的静态 ip,例如:
归档时间: |
|
查看次数: |
39866 次 |
最近记录: |