my guest can't get ip form my network dhcp? - ip

i set below configuration for guest
image description here
but after set it and restart my guest, it can't get IP from my network DHCP!!!!
how can i solve it?

The network settings on virtualbox look good, as long as the interface is correct.
What is the guest os?
Have you tried the following on the vm?
if windows: run ipconfig /release then ipconfig /renew on cmd, or run diagnostics on the interface. You can also try to disable and enable the interface. If nothing works, try setting up a static IP in the same subnet as the dhcp server and check if the server is reachable via ping (if it's not, troubleshoot your network).
if linux: dhclient [interface], also check if the interface is set to static or dhcp, set the correct mode otherwise you will have to run dhclient again if you reboot or shutdown the vm

Related

How do I access my Ubuntu Server installed on Virtual box from anywhere in the World

I am trying to make an IOT using nodemcu and a LED. I want to access the Ubuntu Server(which is installed in the virtual box) through some other network(outside my LAN). How can I do it? I read many articles online, but I am not able to figure it out. I tried port forwarding but it did not work.
I am not sure what I am doing wrong. Is there's a problem in the port forwarding, or I am following a wrong method.
I have installed Ubuntu Server 16.04 LTS on my laptop via VirtualBox. I have installed LAMP. Also, network set to bridged adapter, plus I have dynamic IP
As I logged in, I ran ifconfig. It gave me the inet address as 192.168.16.101
Did you set the VM network interface to be NAT or Bridged?
If it is NAT, then you are essentially double NATTed which means you will need to port forward from your router to the VM host and then you will need to port forward from the host to the VM as the IP assigned will be local to the host machine.
However, the easiest is to set the VM network interface to Bridged.
This will mean the VM will be able access your network directly as it should be on the same subnet as your laptop and appear as another device, which your router will be able to port forward to.

Get IP of VM running on an Ubuntu server configured on bridged networking

I want to set up an exported VM on an Ubuntu Server using VirtualBox on headless mode.
I have the VM up and running and bridged with the ethernet interface of the host (em1), so the dhcp of the host should now assign an IP to the VM if I'm not mistaken.
Is there a way to check if this is working and if yes to get the VM's IP?
Since this is on headless mode so without GUI, the only way to login to the VM is through ssh and for that I need the IP..
welthenwel,
you can do this with VBoxManage.
from a shell, just type:
VBoxManage guestproperty enumerate VM_NAME --pattern */IP
and you will get as response something like in the below image.
now, ignore the fact that I run this cmd from a Windows host, because its behaves exactly the same from inside a linux host
I'm not very familiar with VirtualBox. Bridged with VMWare Workstation meant the IP is given by your default DHCP server, which means you could look up the assigned IP address there (e.g. your router - if you have access to it).
Another option would be a ping sweep of your network segment as I believe Ubuntu doesn't drop ICMP requests.

SSH from Virtualbox Guest to DynDNS address

I have Windows 10 as host with a Manjaro installation as Guest on Virtualbox.
I have set a Debian server on another house with ssh installed. I have setup a dyndns on Debian's network so I can access it remotely.
For example..
From address 12.34.56.78 I ssh to foo.dyndns.org:1234. This port redirects me to 192.168.1.5:22 always as this is my Debian machine and the connection is established. I am able to do this from Windows 10 as well as my android and any other device in 12.34.56.78 or by 3G.
But..
When I try to do this
$ ssh foo.dyndns.org:1234
from the Manjaro Guest in Virtualbox I get the following error:
ssh: Could not resolve hostname foo.dyndns.org:1234: Name or service not known
So I did ifconfig and I saw my inet address was 10.0.2.15. I changed virtualbox's network adapter from NAT to Bridged so I can get a lan ip and I got the host's ip, 192.168.2.4. So I gave it another try and still didn't work.
Also, if i try to connect from vm to server while I'm in the same network
$ ssh user#192.168.2.5:22
it works. In this case virtualbox's network adapter was NAT.
This command works if I try from my android (connectbot).
I can connect the same way from PuTTY from Windows.
So my questions are:
Can it be done?
If so, how? (and why?)
Can a VBox Guest get lan ip that's not the same as the host's?
Is there any more information I should provide?
I have searched for a couple of days in here and on google and all I found where solutions on how someone can ssh INTO a vm. No one (from what I saw) asked the opposite.
Checking manual page for ssh reveals the format of command-line options:
ssh [...] [-p port] [...] [user#]hostnamessh
This simply describes, that you need to change
ssh foo.dyndns.org:1234
to
ssh -p 1234 foo.dyndns.org
if the domain resolves correctly to the ip address.

Host Only connection NetBSD to Windows

I have NetBSD-4.0.1-x68k installed as a guest virtual machine on Windows (using the XM6i 68030 emulator for windows 7). I am trying to setup a host only connection on the NetBSD guest. However, I can't ping the guest from the host unless I run:
tcpdump -i ne0 #executed on guest
ping 192.168.2.17 #executed on host
ping 192.168.2.1 #executed on guest
Right after I run these commands in that order I can continue to ping successfully ...but not forever, after a certain point I am unable to ping again from neither the host nor guest. Also, when I restart the system, I still can only do pings unless I do the above process beforehand, and again, not forever.
Is there anyway I can setup this host only connection without using tcpdump as a short term temporary handicap?
I turns out on the latest version of XM6i. In order to get a complete 68030 networking emulation you need to use tcpdump command on boot. So there is no way around this.

Cannot ping localhost but can access through browser

I am using wamp on my Win 7 laptop.
localhost and 127.0.0.1 is accessible from the browser (Chrome) but when I'm try to run ping localhost or ping 127.0.0.1 from the command prompt, I'm getting timeout.
I have a few virtual hosts created at wamp too, and I've added them to hosts file, and they too are accessible from browser but ping fails from cmd.
Also, running ipconfig doesn't show anything about the wamp localhost. The other ips that I get at ipconfig are getting pinged. Lastly, I cannot access my localhost using the ip on other devices connected to Laptop wifi hotspot created by mHotspot.
Someone please explain this behaviour to me, and help me access my localhost from my other devices. Thanks!
It sounds like your TCP stack is in some way corrupted.
This may clear the issue
Open a command prompt as Administrator and Run
netsh winsock reset
netsh winsock reset catalog
netsh int ip reset reset.log
netsh int ipv4 reset reset.log
netsh int ipv6 reset reset.log
ipconfig /flushdns
Reboot if necessary
Try ping again

Resources