Is it possible to get ip address of VM's without installing ESXI tools? - virtual-machine

I am using vSphere client to get informations from the installed VM.
I have gone through the following link :
http://benohead.com/getting-info-from-your-esx-server-using-the-vmware-infrastructure-vsphere-java-api-part-1/
and managed to get which ip's are up/down. I need the IP address.There is no tools installed. Is it possible to get IP address without installing Esxi tool?

You need to install the VMware tools if you would like to fetch the IP address. But without installing the VMware Tools there is an another way to fetch the IP address by using VM Name
In VirtualMachineConfigInfo class, getName() will return the VM Name or by using vm.config.name will return VM name and then pass the VM name to the below code
String ipAddress = InetAddress.getByName(<<VIRTUALMACHINENAME>>).getHostAddress();
Note: This code will works only if the host name is resolvable.

In short, it isn't. If it was, that'd break the whole illusion of virtualization.
There is another way, though, but it requires instrumenting the VMs. If you can install an agent inside the VM that broadcasts/pings it's IP to the outside world through some mechanism, that'd be a solution. Can't think of any other way you can get the IP of a machine. Not through the vsphere sdk definitely.

Related

Windows Server 2019 - VMs on Hyper-V cant get network

I have some trouble with my windows server 2019 running Hyper-V, for the background my windows server run on an ESXI infra.
It is impossible for me to get any internet access nor domain access on my Hyper-V virtual machine, this is how my host configuration look like
Host network
For me all look good, but when I turn on my virtual machine this is what I get
VMs network
VMs ping
I can see the machine getting a IP from my DHCP server, but it is impossible for me to ping any of the gateway, DNS.
My DHCP
This is how my virtual switch look like
vSwitch Hyper-V
And if needed my Ipconfig of my Windows server Hyper-V host
Hyper-V host network
I think that i have now tried everything I could, I don't see why my machine can get a DHCP IP, but can't communicate with any of my server.
I already have a topic posted on SpiceWorks (https://community.spiceworks.com/topic/2326264-hyper-v-wont-provide-internet-access-on-my-virtual-machine?page=1#entry-9231547), the last answer suggested that the problem came from my vSwitch on Hyper-V, but even after recreating a new one I can't get anything.
If you have any idea that can help me to achieve my configuration even the slightest one I'll gladly take it.
First thing I would like to ask, you are doing a Double Nested Virtualization, meaning: [ESXi] is the BareMetal Hypervisor, then inside of this Host you have at least 2 VMs, one name "SRVPARDC001" & the Hyper-V VM named "TESTHYPERV" , and inside this last one you have another VM called "VDI-Master" , if this is correct, you are asking:
*Why is VDI-Master, not getting internet, when SRVPARDC001 has leased an IP address ( 192.168.1.118) ?
My question is, why does the ipconfig output for VDI-Master show IP 192.168.1.121 , which per your DHCP, should be leased to the Desktop
Would it be possible to use a different subnet for the Virtual Switch inside the Hyper-V , to eliminate routing/dhcp issues?
My impression is that there is an issue on how the virtual switch is configured on the TESTHYPERV vm, since that virtual switch should be allowing the traffic upstream to the ESXi host and then out via your gateway/router/firewall device.

Why can't my friends access my website built with Apache2?

So, I have been building this website with HTML and I decided to host it with on Apache2. It runs on an Ubuntu and me already changed the VM assigned Ip, which is 10.2.0.15, into another one. I can access it on the Mac where the VM is, but I asked my friend if he can open it, and he said it was a 404 Server not found error.
Please help!
You probably need to enable port forwarding:
https://www.howtogeek.com/122641/how-to-forward-ports-to-a-virtual-machine-and-use-it-as-a-server/
You haven't indicated what VM software you are using, but the above is for VirtualBox. VMware is a bit different. Also make sure your router is not blocking any packets or any firewall.

Accessing VM's terminal using putty in host OS?

I am working on a project in which we logon to client's machine using Cirtix receiver. The machine which we connect to using Citrix receiver is basically a Windows 7 machine. Once we are in the client's windows box, inside that we have virtual box, in which VM has been added and which has all the needed software for us to do the development; for example JBOSS, database etc.
In the host machine (windows 7), we have putty, and using putty we sometimes login to the VM (i.e. terminal). The confusion which I have is as below:
We login to the VM terminal using IP address: 127.0.0.1. This is where my confusion is. 127.0.0.1 normally is the IP address with which we can refer to the current machine; so how using this IP address we are able to connect to the VM which is added to the virtual box? Doesn't the VM which is in virtualbox has its own IP address with which we can connect to? Or is there some concept which I am not aware of.
Can anyone help me in understanding this? I am not well versed with virtualization, so for the gurus this might be a naive question.
Every VM will have their uuids so to access the VM inside virtualBox or any hypervisor for that matter. so you can use that particular VM uuid and u should be able to console to that VM.
in virtual box try below
You can use: VBoxManage list vms to list all currently registered VMs with their settings, names and UUIDs.
Once you know the UUID you can also start a vm by:
VBoxManage startvm which is essentially same as: VBoxManage startvm "Name-of-vm"
Also Vm has two interfaces one loopback which will have an address of 127.0.0.1 and the rest of the interfaces so to access the VM with particular ip you need to assign an IP to that VM interface and than try with that IP.Also you might have that port 22 open for that loopback ip so may be that is the reason you are able to connect on loopback
I hope this answers your question

How to detect an Arduino Yún / Yún shield IP address on a LAN

I'm writing code on a server to interact with an Arduino Yún shield via SSH. Is there a way for the server to detect the Yún shield LAN IP address automatically just like the IDE?
I ran into this and found out that the Yún runs a Bonjour compatible daemon called Avahi which sets a domain of arduino.local in your local network which makes the IDE aware of the board existence. I know because I have a Yún shield (not Yún) which by default gets assigned a different Bonjour name so the IDE can't recognize it.
So, if you need to access the Yún by name locally check the Avahi daemon configuration to see what name is used. If you need to access it from outside it's still possible by using a service like noip and opening the port on your router.
Please mark the answer as correct if this answers your question.
It is not possible as your device may get an IP address from the ISP dynamically. Your device has to connect to your server and tell its IP address.
You can try something like, TCP/IP.

how do i reach apache on a vitualbox machine

I am trying to run a virtual LAMP machine on my windows 7 for dev purposes. But i cant figure out how to reach the apache from the host windows 7 system. I did an ifconfig and tried the ipaddress, but to no avail.
If you set virtualbox to use bridged (regular) networking then it's no different from any other machine on the LAN, if you set host only then you can still call it - you just need to know it's IP address.
See http://opensourceexperiments.wordpress.com/2008/04/18/virtualbox-case-study-making-host-only-networking-work-between-two-ubuntu-guest-os-virtual-machine-on-windows-vista-host/
You will need to set the networking mode of your VM in virtualbox.
Bridged will allow others on the LAN
to access your VM.
Host-Only will allow your host and
any other VM's also configured as
host-only to access one another.
Virtual Box Neworking
If you look at the link you will have many different options on the type of networking you can do.
as mentioned earlier, I recommend either:
Bridged networking that makes the box look like an other computer on your network. They you may use ipconfig on the box or verify your router logs.
Host-Only networking is where your windows 7 will be its own network between the box and windows and then you may use the Ip address from ipconfig.