Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the IP address used by a Parallels VM from the host?

Tags:

parallels

Parallels has a command line API which is documented here

>prlctl list
UUID                                    STATUS       IP_ADDR         NAME
{ca50aac6-caa6-47a6-9bfe-e38f6261cb8d}  running      -               win7

Still, even with this the IP_ADDR reported is always empty, even if the machine is running as has an internet connection.

How can I find the IP of the machine from the guest? I need a way to connect to the guest, by using a domain name or an IP.

like image 709
sorin Avatar asked Jul 27 '13 10:07

sorin


People also ask

How do I find my IP address in Parallels?

Open System Preferences -> Network and check what IP address the Parallels NAT network service has.

How do I find the IP address of my VM?

Checking an IP Address in VMware vSphere ClientGo to Hosts and Clusters, select the needed VM by name and check the Summary tab. The VMware IP addresses of the virtual machine are displayed in the IP addresses section. One VM can have multiple virtual network adapters and multiple IP addresses.

What are the IP addresses assigned to your virtual machine?

VM interfaces are assigned IP addresses from the subnet that they are connected to. Each VM interface has one primary internal IPv4 address, which is assigned from the subnet's primary IPv4 range. If the subnet has an internal IPv6 range, the VM interface can optionally be configured with an internal IPv6 address.

Do VMS get their own IP address?

A virtual machine (VM) is automatically assigned a private IP address from a range that you specify. This range is based on the subnet in which the VM is deployed.


2 Answers

If it's a Windows VM, you can get the IP with the following command from the host:

prlctl exec "VM Name" ipconfig | grep "IPv4" | grep -o '\d\{1,3\}\.\d\{1,3\}\.\d\{1,3\}\.\d\{1,3\}'

For a *nix VM:

prlctl exec "VM Name" ifconfig eth1 | grep "inet " | grep -o 'addr:\d\{1,3\}\.\d\{1,3\}\.\d\{1,3\}\.\d\{1,3\}' | grep -o '\d\{1,3\}\.\d\{1,3\}\.\d\{1,3\}\.\d\{1,3\}'
like image 192
JKubecki Avatar answered Oct 22 '22 12:10

JKubecki


if you want to access the machine using SSH there is a built in command that can help with this.

prlctl enter <VM_ID|VM_NAME>

This will open a prompt as root to the VM if you want the IP for any other reason there is another way to get it

prlctl exec <VM_ID|VM_NAME> ifconfig

The exec command from prlctl will execute the ifconfig command on the host linux machine (if using windows do ipconfig instead of ifconfig)

All the output of the ifconfig will be printed on your terminal and the ip will be clearly visible in the output

like image 21
yshahin Avatar answered Oct 22 '22 12:10

yshahin