0

I run Ubuntu Desktop 16.04 as my host machine. I use Virtual Box to run Ubuntu Server. I SSH to my Ubuntu Server virtual machine using NAT network with port forwarding.

With these settings I can SSH without an actual Internet connection but I can’t SSH with my modem turned off.

The problem is that I live in place with constant “power-cuts” (which basically means electricity board cutting down power). So when power went off although my laptop stays up with battery, my modem turns off, this breaks the connection between VirtualBox and the host machine. I use a D-link Modem.

Here is the out put of "ip addr show":

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 34:e6:d7:80:7d:f2 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.3/24 brd 192.168.1.255 scope global dynamic enp7s0
       valid_lft 85636sec preferred_lft 85636sec
    inet6 fe80::a9a6:c6a7:8e7:86fd/64 scope link 
       valid_lft forever preferred_lft forever
3: wlp6s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether e4:f8:9c:1a:66:48 brd ff:ff:ff:ff:ff:ff
4: vboxnet0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff

I set up host only network but still I can’t SSH to the Virtual Machine. Here is the error I am getting:

ssh: connect to host 192.168.56.10 port 22: No route to host

Please see the pictures below to get better idea:

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Here is the pastebinit from HOST MACHINE here and here:

Name:            ubuntu-13.10-server-amd64
Groups:          /
Guest OS:        Ubuntu (64-bit)
UUID:            eef457f6-5500-4fb5-beae-a2048003eb16
Config file:     /home/hemanth/VirtualBox VMs/ubuntu-13.10-server-amd64/ubuntu-13.10-server-amd64.vbox
Snapshot folder: /home/hemanth/VirtualBox VMs/ubuntu-13.10-server-amd64/Snapshots
Log folder:      /home/hemanth/VirtualBox VMs/ubuntu-13.10-server-amd64/Logs
Hardware UUID:   eef457f6-5500-4fb5-beae-a2048003eb16
Memory size:     1024MB
Page Fusion:     off
VRAM size:       16MB
CPU exec cap:    100%
HPET:            off
Chipset:         piix3
Firmware:        BIOS
Number of CPUs:  1
PAE:             off
Long Mode:       on
Triple Fault Reset: off
APIC:            on
X2APIC:          on
CPUID Portability Level: 0
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): Floppy
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          on
BIOS APIC mode:  APIC
Time offset:     0ms
RTC:             UTC
Hardw. virt.ext: on
Nested Paging:   on
Large Pages:     off
VT-x VPID:       on
VT-x unr. exec.: on
Paravirt. Provider: Default
Effective Paravirt. Provider: KVM
State:           powered off (since 2017-01-20T13:01:04.880000000)
Monitor count:   1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address: 
Teleporter Password: 
Tracing Enabled: off
Allow Tracing to Access VM: off
Tracing Configuration: 
Autostart Enabled: off
Autostart Delay: 0
Default Frontend: 
Storage Controller Name (0):            IDE
Storage Controller Type (0):            PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  2
Storage Controller Port Count (0):      2
Storage Controller Bootable (0):        on
Storage Controller Name (1):            SATA
Storage Controller Type (1):            IntelAhci
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1):  30
Storage Controller Port Count (1):      1
Storage Controller Bootable (1):        on
IDE (1, 0): Empty
SATA (0, 0): /media/hemanth/1f8872a7-c976-429e-b9a4-5ff4611ce1b6/Virtual_harddisk/ubuntu-13.10-server-amd64.vdi (UUID: 78d9d5a9-8aa1-4fc0-b756-69f4f9b193ae)
NIC 1:           MAC: 080027074B42, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 1 Settings:  MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 2:           MAC: 08002796592D, Attachment: Host-only Interface 'vboxnet0', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
Pointing Device: USB Tablet
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
UART 3:          disabled
UART 4:          disabled
LPT 1:           disabled
LPT 2:           disabled
Audio:           enabled (Driver: PulseAudio, Controller: AC97, Codec: AD1980)
Clipboard Mode:  disabled
Drag and drop Mode: disabled
VRDE:            disabled
USB:             enabled
EHCI:            disabled
XHCI:            disabled

USB Device Filters:

<none>

Bandwidth groups:  <none>

Shared folders:  <none>

Video capturing:    not active
Capture screens:    0
Capture file:       /home/hemanth/VirtualBox VMs/ubuntu-13.10-server-amd64/ubuntu-13.10-server-amd64.webm
Capture dimensions: 1024x768
Capture rate:       512 kbps
Capture FPS:        25

Guest:

Configured memory balloon size:      0 MB


Name:            ubuntu-16.04.1-server-amd64
Groups:          /
Guest OS:        Ubuntu (64-bit)
UUID:            985fda5c-3f3b-4046-a3e7-7b0f3636870e
Config file:     /home/hemanth/VirtualBox VMs/ubuntu-16.04.1-server-amd64/ubuntu-16.04.1-server-amd64.vbox
Snapshot folder: /home/hemanth/VirtualBox VMs/ubuntu-16.04.1-server-amd64/Snapshots
Log folder:      /home/hemanth/VirtualBox VMs/ubuntu-16.04.1-server-amd64/Logs
Hardware UUID:   985fda5c-3f3b-4046-a3e7-7b0f3636870e
Memory size:     1024MB
Page Fusion:     off
VRAM size:       16MB
CPU exec cap:    100%
HPET:            off
Chipset:         piix3
Firmware:        BIOS
Number of CPUs:  1
PAE:             off
Long Mode:       on
Triple Fault Reset: off
APIC:            on
X2APIC:          on
CPUID Portability Level: 0
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): Floppy
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          on
BIOS APIC mode:  APIC
Time offset:     0ms
RTC:             UTC
Hardw. virt.ext: on
Nested Paging:   on
Large Pages:     off
VT-x VPID:       on
VT-x unr. exec.: on
Paravirt. Provider: Default
Effective Paravirt. Provider: KVM
State:           running (since 2017-01-20T13:01:35.359000000)
Monitor count:   1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address: 
Teleporter Password: 
Tracing Enabled: off
Allow Tracing to Access VM: off
Tracing Configuration: 
Autostart Enabled: off
Autostart Delay: 0
Default Frontend: 
Storage Controller Name (0):            IDE
Storage Controller Type (0):            PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  2
Storage Controller Port Count (0):      2
Storage Controller Bootable (0):        on
Storage Controller Name (1):            SATA
Storage Controller Type (1):            IntelAhci
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1):  30
Storage Controller Port Count (1):      1
Storage Controller Bootable (1):        on
IDE (1, 0): Empty
SATA (0, 0): /media/hemanth/1f8872a7-c976-429e-b9a4-5ff4611ce1b6/Virtual_harddisk/ubuntu-16.04.1-server-amd64.vdi (UUID: 52e25a62-bef7-41df-a04b-06b90d2f36e5)
NIC 1:           MAC: 0800276260D8, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 1 Settings:  MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 1 Rule(0):   name = ssh, protocol = tcp, host ip = 192.168.1.3, host port = 2000, guest ip = 10.0.2.15, guest port = 22
NIC 2:           MAC: 080027354E37, Attachment: Host-only Interface 'vboxnet0', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
Pointing Device: USB Tablet
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
UART 3:          disabled
UART 4:          disabled
LPT 1:           disabled
LPT 2:           disabled
Audio:           enabled (Driver: PulseAudio, Controller: AC97, Codec: AD1980)
Clipboard Mode:  disabled
Drag and drop Mode: disabled
Session name:    GUI/Qt
VRDE:            disabled
USB:             enabled
EHCI:            disabled
XHCI:            disabled

USB Device Filters:

<none>

Bandwidth groups:  <none>

Shared folders:  <none>

Video capturing:    not active
Capture screens:    0
Capture file:       /home/hemanth/VirtualBox VMs/ubuntu-16.04.1-server-amd64/ubuntu-16.04.1-server-amd64.webm
Capture dimensions: 1024x768
Capture rate:       512 kbps
Capture FPS:        25

Guest:

Configured memory balloon size:      0 MB

IP4.ADDRESS[1]:                         192.168.1.3/24
IP4.ADDRESS[1]:                         192.168.56.1/24
IP4.ADDRESS[1]:                         127.0.0.1/8

Here is the pastebinit from GUEST MACHINE right here:

IP4.ADDRESS[1]:                         10.0.2.15/24
IP4.ADDRESS[1]:                         127.0.0.1/8
6
  • I suppose your desktop is using network-manager. This might cause the problem while it shouldn't. Can you extend your question with the output of "ip addr show" for both cases? (while modem is running, while modem is powered off).
    – goteguru
    Commented Jan 19, 2017 at 23:31
  • i added output of "ip addr show"
    – faust_
    Commented Jan 19, 2017 at 23:43
  • @JakeGould I did that but still I am not able to SSH to virtual machine. I run the command "ssh [email protected]" , I don't know the port name. I
    – faust_
    Commented Jan 20, 2017 at 0:03
  • and if you poweroff the modem, you see the same interfaces? Can't ssh is a bit under-defined. What's the error message? You can't route to the server ip? (ip route might help). Maybe you are using some server name instead of IP and your resolver can't find that (try connect with ip). There are too many possibilities.
    – goteguru
    Commented Jan 20, 2017 at 0:12
  • 1
    you have an IP 192.168.56.10 in your ubuntu16 lo device. That should be 127.0.0.1. you may (temporarily ) change it with ip addr del 192.168.56.10 dev lo and restore the right version with ip addr add 127.0.0.1 dev lo. According to your screenshots, your host machine cannot route the right address. If the above wont help, please add your routing tables (ip route show) on both machines.
    – goteguru
    Commented Jan 20, 2017 at 16:58

0

You must log in to answer this question.

Browse other questions tagged .