Could not resolve hostname 192.168.56.2

Hi!
I trying configure OpenWRT on Virtualbox for test LuCi
with this tutorial https://openwrt.org/docs/guide-user/virtualization/virtualbox-vm
and inside is

  1. edit the network configuration to allow SSH access by writing these commands and pressing enter:
    a. uci set network.lan.ipaddr='192.168.56.2'
    b. uci commit
    c. reboot
  2. now your VM should be accessible from SSH, user root (no password) address 192.168.56.2

After reboot I can not login

$ ssh root@192.168..56.2
ssh: Could not resolve hostname 192.168..56.2: Name or service not known

I use 1openwrt-18.06.1-x86-64-combined-ext4.vdi

Edited.
My mistake " .." inside IP, but still I have problem :frowning:
connect to host 192.168.56.2 port 22: Connection refused

Edited.
uci show network shows network.lan.ipaddr='192.168.56.2'
my ifconfig from my system show

vboxnet0  Link encap:Ethernet  HWaddr 0A:00:27:00:00:00  
          inet addr:192.168.56.1

Is this correct?

Edited
I tried also connect from OpenWrt

ssh root@192.168.56.2
Host '192.168.56.2' is not in the trusted host file
(ssh-rsa ...
Do you want to continue  connecting ? (y/n) y
root@192.168.56.2' s password:
root@192.168.56.2' s password:

I can not login.

Edited
I changed empty password ( passwd )
and now I can login inside virtualbox
But how do this from my system ?

  • Are you 100% certain that you have connected the virtual network cards to a real network?
  • If this is the LAN of your real network, it is addressed 192.168.56.0/24, correct?
  • Did you setup a LAN and WAN network card?
1 Like

https://www.virtualbox.org/manual/ch06.html#networkingmodes
To access a guest from the host you should use either bridged or host-only network mode.

1 Like

Are you 100% certain that you have connected the virtual network cards to a real network?

Not
ifconfig from OpenWRT shows
br-lan ... inet addr:192.168.56.2 Bcast:192.168.56.255 Mask:255.255.255.0
eth0 not working because don't have IP
on my system ifconfig shows
vboxnet0 ... inet addr:192.168.56.1 Bcast:192.168.56.255 Mask:255.255.255.0

Did you setup a LAN and WAN network card?

I'm doing everything exactly according to the guide https://openwrt.org/docs/guide-user/virtualization/virtualbox-vm
however I do not understand how setup two cards can fix problem and give acces to 192.168.56.2

I tried also create file without ssh ( inside OpenWrt )
but I have

uci batch <<EOF 
set network.mng=interface
...
uci: Entry not found

Edited
Thanks, vgaetera for link.

You should first confirm this. Only you know what network you want to connect to and why. This is done on the following VirtualBox screen:

Screenshot%20from%202018-10-15%2010-43-06

  • What device do you wish to be the router...why is your host machine 192.168.56.1?
  • Can you explain why you are setting up a OpenWrt Virtual Machine? Maybe that will help.

I NEVER SAID 2 CARDS FIX THE PROBLEM...I asked you if you properly connected the Interfaces. You cannot reach the VM until you have physically connect it to the real network.

Can you just explain what you're trying to do, as I'm very familiar with the VM setup. I'm not sure why your host machine has the IP 192.168.56.1.

1 Like

Can you explain why you are setting up a OpenWrt Virtual Machine? Maybe that will help.
Can you just explain what you're trying to do

lleachii
Open link https://openwrt.org/docs/guide-user/virtualization/virtualbox-vm
check section VM setup
and you will know more.
And I agree that I should set bridge for connect shh from my system to virtualbox
with use local IP from bridge.
And I want setup, because I want test Luci / GUI before install on real router / hardware.

LOL :smile:

I don't need this, I have multiple VMs of OpenWrt, I'm trying to help you!

I'm not sure how you agree, I'm still trying to help you.

OK...but can you answer my questions, please:

Try to better explain why your host machine already has the IP 192.168.56.1, yet you are configuring a router at 192.168.56.2 with a LAN (and I assume a DHCP server already).

1 Like