Why cant I ping a virtual guest from host by default - virtual-machine

I ran into some trouble when I tried to ping my Ubuntu virtual guest from my Windows 10 host, but this solution did the trick.
I'm wondering what exactly is a "host-only-adapter" and why cant the I ping the virtual machine by default? How exactly does the virtual machine access the internet when I cant ping it?

As the name suggests, host-only is intended to create a new interface that is virtual and visible to the host and not in anyway connected to the physical interface that actually connects to the internet.
Itcan be thought of as a hybrid between the bridged and internal networking modes: as with bridged networking, the virtual machines can talk to each other and the host as if they were connected through a physical Ethernet switch. Similarly, as with internal networking however, a physical networking interface need not be present, and the virtual machines cannot talk to the world outside the host since they are not connected to a physical networking interface.
You might be wondering what the use-case for this would be.Think for example: one virtual machine may contain a web server and a second one a database, and since they are intended to talk to each other, the appliance can instruct VirtualBox to set up a host-only network for the two. A second (bridged) network would then connect the web server to the outside world to serve data to, but the outside world cannot connect to the database.
How it works
when host-only networking is used, VirtualBox creates a new software interface on the host which then appears next to your existing network interfaces. In other words, whereas with bridged networking an existing physical interface is used to attach virtual machines to, with host-only networking a new "loopback" interface is created on the host. And whereas with internal networking, the traffic between the virtual machines cannot be seen, the traffic on the "loopback" interface on the host can be intercepted.
The great thing about host-only networks is that the host itself sits on this network and so, upon proper config as in you link above, you can reach all the VMs.
Hope my explanation helps!

Related

Hyper-v Open Virtual Machine

After rebooting is it possible to open a Hyper-V virtual machine without going through the Manager? It seems like it is already running in the background or maybe it is just in its last state.
If the OS in the Hyper-V virtual allows for remoting and also it is on the same network as the attempt to open a remote desktop to that virtual.
Note that the default network adapter for a virtual will provide a different IP address than what the local network provides to the server. You will most likely want to create a network adapter (in Hyper-V) which shares the network card to the virtual and the virtual will get its IP address from the local network.
If you can ping it, then it can be remoted to..but other things within the virtual has to allow for remoting.
Upon reading the OPs comments, it is clear that the need is to launch the virtual outside of Hyper-V. Hyper-V uses VMConnect.exe to achieve that...and that is available.
One can do that in an elevated Powershell shell such as:
vmconnect {Local/remote computer name} {Virtual Name}
such as
vmconnect Hyperion W10-Zephyr
where Hyperion is the local computer name and W10-Zephyr is the virtual's name.
See also Connecting to Hyper-V virtual machines with PowerShell

Wireless network causes virtual machines to be inaccessible by outside world

I currently have two Ubuntu 14.04 virtual machines running on a windows 7 host. The virtual machines are configured to use a bridged network adapter.
When the host machine is hardlined to the internet, the virtual machines are able to ping the outside world as well as be ping by the outside world.
When the host machine is on a wireless network, the virtual machines cannot ping the outside world, and the outside world is not able to ping the virtual machines.
When connected to a wireless network, I receive the 'Destination host unreachable' error when pinging either from the virtual machines to outside, or from outside to the virtual machines.
It may be worth noting that these virtual machines are being run inside VirtualBox. Also something which may be applicable here, section 6.5 of the virtualbox manual states:
Bridging to a wireless interface is done differently from bridging to
a wired interface, because most wireless adapters do not support
promiscuous mode. All traffic has to use the MAC address of the host's
wireless adapter, and therefore VirtualBox needs to replace the source
MAC address in the Ethernet header of an outgoing packet to make sure
the reply will be sent to the host interface. When VirtualBox sees an
incoming packet with a destination IP address that belongs to one of
the virtual machine adapters it replaces the destination MAC address
in the Ethernet header with the VM adapter's MAC address and passes it
on. VirtualBox examines ARP and DHCP packets in order to learn the IP
addresses of virtual machines.
I'm not sure what may be causing this issue. Accessing these virtual machines from the outside world when switching between networks is necessary in my situation. Any ideas as to what may be going on?
Thanks in advance for any help!
Just to provide some value to those who may stumble upon this issue in the future:
The source of this problem stems from a setting within virtualbox. Open virtualbox, and under the Settings > Network > Adapter page, there is a name field.
If attempting to connect to the virtual machines over a wired connection, select your host machines Ethernet adapter.
If attempting to connect to the virtual machines over a wireless connection, select your host machine's wireless adapter.
Hope this helps someone out there!

Cannot do Vagrant ssh after Vagrant up on windows Machine

I am building a sample vagrant box to install Jenkins and push it to atlas cloud.Please find below the steps that I followed.
Vagrant init ubuntu/trusty64
and the normal command to initialize the vagrant machine.
vagrant up
After this if i type command to ssh into the machine
vagrant ssh
It gives me error saying please increase timeout and so.
The main question is how can I ssh into the newly created vagrant machine.
To understand this, I have to go through all the basics. Please find below my findings.
Not attached
In this mode, VirtualBox reports to the guest that a network card is present, but that there is no connection -- as if no
Ethernet cable was plugged into the card. This way it is possible to "pull" the virtual Ethernet cable and disrupt the connection, which can be useful to inform a guest operating system that no network connection is available and enforce a reconfiguration.
Network Address Translation (NAT)
If all you want is to browse the Web, download files and view e-mail inside the guest, then this
default mode should be sufficient for you, and you can safely skip the rest of this section. Please note that there are certain limitations when using Windows file sharing (see Section 6.3.3, “NAT limitations” for details).
NAT Network
The NAT network is a new NAT flavour introduced in VirtualBox latest versions.
Bridged networking
This is for more advanced networking needs such as network simulations and running servers
in a guest. When enabled, VirtualBox connects to one of your installed network cards and exchanges network packets directly, circumventing your host operating system's network stack.
Internal networking
This can be used to create a different kind of software-based network which is visible to selected virtual machines, but not to applications running on the host or to the outside world.
Host-only networking
This can be used to create a network containing the host and a set of virtual machines, without the need for the host's physical network interface. Instead, a virtual network interface (similar to a loopback interface) is created on the host, providing connectivity among virtual machines and the host.
Generic networking
Rarely used modes share the same generic network interface, by allowing the user to select a driver which can be included with VirtualBox or be distributed in an extension pack.
At the moment there are potentially two available sub-modes:
UDP Tunnel
This can be used to interconnect virtual machines running on different hosts directly, easily and transparently, over existing network infrastructure.
VDE (Virtual Distributed Ethernet) networking
This option can be used to connect to a Virtual Distributed Ethernet switch on a Linux or a FreeBSD host. At the moment this needs compiling VirtualBox from sources, as the Oracle packages do not include it.
Out of these, only NAT and Host-only network is important.So, to solve this issue, I modified the predefined Vagrant file with the following code.
jenkins.vm.provider "virtualbox" do |vb|
jenkins.vm.network "private_network",ip:'192.168.56.5',:adapter => 2
jenkins.vm.hostname = 'jenkins.ci'
vb.name = "Jenkins"
end
Here, I have created a private network with static Ip and also, I specified the adapters count to use 2. The Private adapter is Host-only adapter and 1st adapter which is default one is NAT.

How can I configure a Client Hyper-V (on Windows 8) to connect to the host and other VMs without a network connection?

I'm trying to develop an interface to an application that doesn't run on Windows 8. Hence, I've created a VM with Windows 7 running the integration service and another service running on the Windows 8 host.
I have three Virtual Network scenarios configured for Hyper-V: Wireless, Shared and Internal. Where Wireless allows all VMs and the host to connect to a wireless network (External), Shared let's the VMs connect through the host via a VPN (Internal) and Internal creates a network within the host where the VMs don't have network access (Private).
When I'm in Wireless (External) mode and there's a wireless network to connect to, everything works fine as if I were testing using to physical PCs on a wireless network. However, today I had a situation where I wasn't connected to a network but still wanted to do some testing and I could not get the VM to see the host and vice-versa. This scenario was quite straight forward to create on VMware which I used before switching to Hyper-V...
Has anyone managed to make Client Hyper-V VMs and the host communicate without a network? Can you guide me how to set it up?
Wireless networking under Windows 8 Hyper V can not communicate with multiple VM the Wireless NIC is assign to only one Hyper V internet connection,
Meaning only one Hyper V can connect to the Internet preventing others from connecting unless you use multiple Nic's Wireless Network Cards or USB Wireless Network.
It is only after you restart or shut down your computer that Hyper-V problems start.
So if you can not connect any of your Hyper VMs then you problem could be due to a shutdown error that Hyper-v in counted Try restarting the whole computer then Hyper- VMs your problem should fix itself.
Might want to try this. I am having similar problems as you and all signs point to this particular solution working, but for me it is not. Might help you, though.
http://blogs.technet.com/b/doxley/archive/2008/07/07/disconnecting-hyper-v.aspx
The solution that DID end up working for me was this:
http://www.elmajdal.net/Win2k8/Enabling_Wireless_Network_For_Hyper_V_Virtual_Machine.aspx

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.