Not able to ping to ESXi6 from centos vm - virtual-machine

I am new to esxi.I have installed centos vm on esxi.esxi is connected to network.I have set the static ip to centos.Problem is when i try to ping esxi from the guest vm, its not pinging.I tried google it but i didnt get the info about ip configuration of guestvm(cent os).what should be the proper configuration to connect it to the network

Can you describe you configuration and task more detailed? In general, after ESXi install in Configuration -> Networking you'll see Standard Switch with vmkernel port "Management network" with ESXi IP and portgroup "Vm Network". If you have no VLANs and one subnet, you need to set VLAN ID on both vmkernel and portgroup to "None (0)", and made same subnet/gateway settings on vmkernel and inside guest. At last, you need to set in VM Settings - Hardware -> Network Adapter 1 -> Network Label to "Vm Network". It's difficult to advise more without info.

Related

Connect Hyper-V VM from WSL (Ubuntu)

I have created a VM on Hyper-V with 2 Network Adapters.
NAT switch for static ip
External Switch (for access internet)
From my command line I was able to connect to the VM with the Nat Switch IP
but from WSL Bash I was not able to connect with IP NatSwitch, but able to connect with ExternalSwitch IP.
Why?
Unfortunately this is the expected behavior. (As of 29/01/2021)
WSL2 uses Hyper-V Virtual Switch, vEthernet (WSL) virtual network adapter, that is providing internal type Hyper-V network that is only accessible from the VM and the Host. The Hyper-V machine has a different virtual network adapter e.g. vEthernet (Default Switch). If that is set to internal that is a different NAT-ed network (subnet) not connected to the WSL one. It is like the Host having 3 NICs and one cable (Cable 1) going to WSL on a subnet that only exists on that adapter/cable and another cable (Cable2) going to Hyper-V guest with a very different subnet on that NIC.
On the other scenario the Hyper-V guest shares the subnet with the Host machine ("Same subnet as the 3rd cable/NIC.") so it is routed back to the VM. See red labels.
There is a workaround in this GitHub issue using port forwarding to Guest VM from WSL.

Knife SSL check fails when workstation is undocked

My Chef workstation is a virtual machine. I initially setup this machine with Hosted Chef server while the machine was docked in my computer's dock and hardlined to the internet.
When I undock the workstation, the knife ssl command fails with the following error:
c2-device#c2failover-VirtualBox:~$ cd chef/
c2-device#c2failover-VirtualBox:~/chef$ knife ssl check
Connecting to host api.chef.io:443
ERROR: Network Error: getaddrinfo: Name or service not known
Check your knife configuration and network settings
c2-device#c2failover-VirtualBox:~/chef$
I have since assigned a resolvable IP address to the VM workstation as it was using DHCP prior. I'm not sure how to resolve this issue or what the issue may be when undocking my workstation. Does anyone have any possible causes or solutions to the issue I'm seeing?
my network interface is configured as follows:
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address XXX.XXX.X.XXX
netmask XXX.XXX.XXX.X
gateway XXX.XXX.XX.XXX
dns-nameservers X.X.X.X
I have not been able to find much in the chef documentation about this issue. Thanks for any help in advance, I'm fairly new to Chef.
This is not related to Chef or knife. You'll need to ensure the VM is able to reach the Internet in general. Overall we do not recommend using a VM as your workstation, you the actual desktop or laptop that you work on.

Proxying a port for Virtualbox NAT is inconvenient - can't I provide the host with an IP instead?

I want to be able to SSH into a VM Guest of Virtualbox where the guests are sharing a NAT Network.
LocalNat Portforwarding (See https://www.pythian.com/blog/test-lab-using-virtualbox-nat-networking/ Set Up Portforwarding) is inconvenient vs. having an IP address on the NAT for the host.
Port forwarding requires me to keep specifying the port, e.g. in scp -P 2222 from-file localhost: and it messes with SSH keys as localhost now has two host identities, my laptop and the VM's ssh-rsa key.
Rather than port-forward, is there not a way of just adding another IP for my Virtualbox host?
Thanks, Martin.
You can set up a host-only network in addition to the NAT network. A host-only network is a local network which can connect to both the host and to individual VMs. The host and the VMs can communicate with each other through it.
Using the virtualbox GUI, go to Virtualbox manager > File > Preferences > Network and set up a host-only network. Enable the DHCP server. You could use these settings:
host adapter address is 192.168.56.1
DHCP server address is 192.168.56.100
Both masks are 255.255.255.0
The server address range is 192.168.56.101-192.168.56.254
This gives you the addresses from ...56.2 through ...56.99 to use as static addresses. You can manually assign them to VM interfaces if you like.
After setting up this network, you should see a virtual interface on your host system with the correct IP address (the one assigned to the adapter).
Now, go to network settings for the VM. Add a new network adapter. Set "attached to" to the "host-only adapter", and the name to the host-only network that you set up earlier.
Start the VM. It should see the host-only adapter in addition to whatever adapters it was using before. If it's a modern operating system, it'll probably query the DHCP server and set up the interface on its own. Alternately, from inside the VM OS, you could manually assign static addresses to these interfaces.
You can assign a host-only adapter to a VM in addition to its existing NAT adapter. In the past I've had a windows VM and an Ubuntu Linux VM set up this way. Both VMs and the host had no trouble communicating with each other as well as the Internet.

Overcoming the loopback device on a VM

Due to various constraints I've found myself in the following situation:
I have access to an API which starts a service on the loopback device of a computer (127.0.0.1). This computer is actually running on a VM being hosted by the client. The client will be using the same API to connect (which, of course, will connect via the loopback device).
The API is intended to be a service which executes on the same machine as the host and the client - it's a communication layer essentially. The two software components (ie, the endpoints), are incompatible, so we have them configured this way: the client hosting the server on a VM.
The VM is Virtualbox, with a Bridged Adaptor network setup.
They're both running Windows XP.
How do I get them to communicate?
EDIT: I cannot make changes to the communication service, but I can make whatever other changes are necessary to the VM or the host.
Expanding on #EJP's suggestion to use port forwarding, the required command is covered in User Manual, ยง6.3.1 Configuring port forwarding with NAT. Suppose your service on guest "VM name" is a web server listening on port 80. You can forward host port 12345 to guest port 80 like this:
VBoxManage modifyvm "VM name" --natpf1 "service,tcp,,12345,,80"
When you browse http://127.0.0.1:12345 on your host, the guest server will respond. You can delete the setting using something like this:
VBoxManage modifyvm "VM name" --natpf1 delete "service"
You can examine the setting using something like this:
VBoxManage showvminfo "VM name"
You're going to have to change the service not to bind to 127.0.0.1 if you can. Otherwise you will have to install some kind of proxy in the VM, or organize some port forwarding if you can.

How do I connect to a localhost service from a hyper-v VM?

I have a WCF service running on "http://localhost:12345/ServiceName". I also have a VM running under hyper-v in Windows 8 public beta. Is there any way that I can connect to this service from the VM? I cant seem to set up a bridged network connection in the hyper-v manager. An alternative would be for the WCF service to bind to the Win8 machine name or IP, but I don't know how I would find out what that endpoint is from the VM side. The WCF service can be changed in any way needed...
Any help would be much appreciated!
Many thanks,
Jon
Not sure this will work with a Windows VM, but I managed to open host's URL from inside an Ubuntu VM:
On Host disable the Firewall or add a rule to allow connections to the respective port (12345 in your case).
On VM edit /etc/hosts, replace 127.0.0.1 localhost with IP_OF_HOST localhost.
Now http://localhost:12345/ServiceName should open from inside the VM.
you can create Virtual Switch in Hyper-V(Virtual Switch Manager) Then you can connect it to your VM(right click on VM ->setting -> create Legaci network adapter -> connect abouve virtual switch to it). after that you should install intigration to Hyper-V for your OS in VM. then you can connect to your virtual switch in your VM. after that you can access internet as well. you your host machine has it. type your host machine's IP address in web browser and you can access any service in host machine
You also need to run as admin on the host machine command shell netsh http add urlacl url=http://*:12345/ user=Everyone where 12345 is the port number of your service.