Is there a way to set the IP address of the VM in the hypervisor?

2

I want to use some virtual machine manager (hypervisor) to some guest operating systems. I know we usually set IP of VMs in the VM desktop or telnet/ssh console. But is there a way to set the IP address of the VM in the hypervisor?

For example, I install VMware Workstation or VMware Player in Windows XP, and install Windows 7 in VMware. I want to set up the IP of Windows 7 in Windows XP, not inside Windows 7.

flypen

Posted 2011-06-25T01:42:18.323

Reputation: 267

What are you actually trying to accomplish? As one poster answered, restricting the IP address range is one way to do it (which you can do if you control your DHCP server or with VMware workstation [or player if you get the Network Editor up and running]). Depending on your goals, you might be able to use the built in NAT functionality in VMware. If you are willing to do some pre-configuration, you can also use VMware Tools installed in the guest to then control the IP from the outside. Xen paravirtual VMs also have the ability to set the IP from the hypervisor. – Jed Daniels – 2011-06-25T17:30:21.103

Answers

3

As far as I am aware, this will not be possible.

Any virtualisation solution simply controls the hardware. You are able to do a variety of tasks at a hardware level such as changing the MAC address, however, the actual IP is configured at a software level.

What you can and should do is to look at unattended setups for Windows using something such as the Microsoft Deployment Toolkit, you can then set the IPs to static during setup. This is what large hosts that deploy servers do.

Alternatively, you can reserve the MAC address of the virtual network adapter at your DHCP server, so that when a machine attempts to get it's IP, it will get the one you set.

However, if you are thinking about this from a security perspective, this can all be broken/changed by the user. Take a look/think about doing something at the switch/network level.

William Hilsum

Posted 2011-06-25T01:42:18.323

Reputation: 111 572

2

I'd suggest using DHCP and restricting the IP address range to a single IP.

Lord Loh.

Posted 2011-06-25T01:42:18.323

Reputation: 896

Can I restrict the VM IP in the hypervisor? – flypen – 2011-06-27T09:53:41.767

Yes. I believe so. I remember seeing options to configure the DHCP server in Virtual Box as well as in VMWare (the version that were out in 2007-2008). – Lord Loh. – 2011-06-27T18:08:06.057