以下是Debian虚拟机网络配置指南:
打开VirtualBox,选择虚拟机,点击“设置”,在“网络”选项卡中选择合适模式,如NAT、桥接等。
/etc/network/interfaces文件,添加或修改内容,如auto eth0,iface eth0 inet static,然后设置address、netmask、gateway、dns-nameservers等参数,保存后重启网络服务sudo systemctl restart networking。/etc/network/interfaces,将iface eth0 inet static改为iface eth0 inet dhcp,保存后重启网络服务。编辑/etc/resolv.conf文件,添加DNS服务器地址,如nameserver 8.8.8.8。
使用ping命令测试网络连接,如ping 8.8.8.8或ping www.baidu.com。