为 Windows XP 虚拟机分配主机名
我想从运行它的 Ubuntu 11.04 主机访问虚拟 Windows XP 计算机。因为虚拟机每次重新启动时都会获得一个新的IP,所以我想通过主机名来访问它。但是,在系统属性 -> 中分配名称“selenium-xp”后,计算机名称部分,我仍然无法从我的 Linux 主机 ping 它...
selenium@selenium-chi:~$ ping selenium-xp
ping: unknown host selenium-xp
有没有办法为虚拟机分配一个名称,以便我始终可以从其 Linux 主机访问它?
谢谢,- Dave
ps - 因为 IP 发生变化,创建 /etc/hosts 条目需要持续维护,我想走免维护路线。
I want to access a virtual Windows XP machine from the Ubuntu 11.04 host it is running on. Because the virtual machine gets a new IP every time it is rebooted, I would like to access it by a host name. However, after assigning the name "selenium-xp" in the System Properties -> Computer Name section, I'm still unable to ping it from my Linux host ...
selenium@selenium-chi:~$ ping selenium-xp
ping: unknown host selenium-xp
Is there a way to assign a name to the virtual machine so that I can always access it from its Linux host?
Thanks, - Dave
ps - Because the IP changes, creating an /etc/hosts entry requires continual maintenance, and I want to go down the maintenance-free route.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 VirtualBox 安装中所做的是添加第二个网络适配器,该适配器设置为“仅主机”。该适配器的 IP 不会更改,因此您可以在主机文件中设置它,而不必担心它会更改。
What I did with my VirtualBox install, was to add a second network adapter, which is set to 'host-only'. The IP for this adapter doesn't change, so you can then set it in your hosts file and never have to worry about it changing.