[已解决]Virtualbox虚拟机是NAT方式上网,但虚拟机内的Stretch连不上网?

最大的社区版本,Ubuntu的发源地
回复
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

[已解决]Virtualbox虚拟机是NAT方式上网,但虚拟机内的Stretch连不上网?

#1

帖子 科学之子 » 2017-04-20 22:20

Virtualbox虚拟机是NAT方式上网,但虚拟机内的Stretch连不上网?

Thu Apr 20 23:01:21 CST 2017补充:
ifconfig -a的输出(debootstrap装的系统,一开始没有,所以耽误了一些时间才传上来)

代码: 全选

enp0s3: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 08:00:27:eb:f2:6c  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Fri Apr 21 02:00:05 CST 2017 补充:
http://www.linuxquestions.org/questions ... 175465295/
For DHCP, the /etc/network/interfaces file should look like this:

代码: 全选

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
Sat Apr 22 10:03:47 CST 2017补充:
不好意思
上面那个eth0是jessie的写法
应该stretch应该把eth0改成enp0s3
感谢5楼提醒
上次由 科学之子 在 2017-04-22 10:07,总共编辑 4 次。
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: Virtualbox虚拟机是NAT方式上网,但虚拟机内的Stretch连不上网?

#3

帖子 vickycq » 2017-04-20 23:47

看看 VBox.log
虚拟机启动过程中看看宿主机系统日志
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: Virtualbox虚拟机是NAT方式上网,但虚拟机内的Stretch连不上网?

#4

帖子 科学之子 » 2017-04-21 0:24

vickycq 写了:看看 VBox.log
虚拟机启动过程中看看宿主机系统日志
stretch-2017-04-21-00-20-36.txt
(63.23 KiB) 已下载 110 次
系统是用debootstrap安装的
会不会是我什么地方没弄好?
终端ping和浏览器都无法访问网络
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: [已解决]Virtualbox虚拟机是NAT方式上网,但虚拟机内的Stretch连不上网?

#5

帖子 poloshiao » 2017-04-21 9:09

ifconfig -a 的输出
enp0s3: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 08:00:27:eb:f2:6c txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0...
1. 沒有分配 IPv4 網址

2. 邏輯網卡名稱是 enp0s3
For DHCP, the /etc/network/interfaces file should look like this:
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
3. 邏輯網卡名稱是 eth0

4. 邏輯網卡名稱 不一致 ?
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: [已解决]Virtualbox虚拟机是NAT方式上网,但虚拟机内的Stretch连不上网?

#6

帖子 科学之子 » 2017-04-22 10:10

poloshiao 写了:
ifconfig -a 的输出
enp0s3: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 08:00:27:eb:f2:6c txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0...
1. 沒有分配 IPv4 網址

2. 邏輯網卡名稱是 enp0s3
For DHCP, the /etc/network/interfaces file should look like this:
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
3. 邏輯網卡名稱是 eth0

4. 邏輯網卡名稱 不一致 ?
当时为了测试看是否是Stretch的Bug,所以我又直接安装了一次Jessie
发现问题依旧,搜索后发现debootstrap安装后的系统默认是不提供网络支持的
需要按照1楼那个方法去配置,当时只是说明一下原理
感谢提醒,1楼已补充
回复