I installed ubuntu server as VM in VirtualBox and then installed Docker in it to run some containers. Installed Portainer in it (so it means the VM is connected to the internet). Now I typed ifconfig to see my IP address and I saw this:
br-70e261a4f7c8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.18.0.1 netmask 255.255.0.0 broadcast 172.18.255.255
inet6 fe80::42:66ff:fe9b:a3f7 prefixlen 64 scopeid 0x20<link>
ether 02:42:66:9b:a3:f7 txqueuelen 0 (Ethernet)
RX packets 211 bytes 3306540 (3.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 228 bytes 33889 (33.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:41:c6:88:8c txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fe80::a00:27ff:feab:bbc0 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:ab:bb:c0 txqueuelen 1000 (Ethernet)
RX packets 89848 bytes 118364599 (118.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 39603 bytes 2588176 (2.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 836 bytes 3376136 (3.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 836 bytes 3376136 (3.3 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
vethfaa59c1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::c4fd:4aff:fe13:a309 prefixlen 64 scopeid 0x20<link>
ether c6:fd:4a:13:a3:09 txqueuelen 0 (Ethernet)
RX packets 211 bytes 3309494 (3.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 215 bytes 32719 (32.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
This is what I get when using traceroute 8.8.8.8:
The host OS is Windows 7. This made me really confused. I have to say I am really new to Linux, have been using Linux Unity for only around the last 6 months.
At first, I thought 10.0.2.15 is my IP address but I can’t SSH into the VM through PuTTY using it. The only way I can SSH is through port forwarding in the VM and then using 127.0.0.1 through that port from PuTTY but the internet does not work through this process and as expected it will work only on the host os, not outside.
To open Portainer I have to enter https://serverip:port, but what is my server IP? And why can’t I ssh into my VM?
P.S. If I use 10.0.2.15 in putty then it says connection refused and the other "inet's" give connection timed out. I even went as far as to install Openbox and Firefox to check Portainer and localhost:port worked flawlessly... but only inside the VM.
EDIT: This is what I want my server to do (if possible)
I open my computer, run my server VM, open PuTTY and SSH into VM from Windows host but internet connection should be there
Take out my laptop running Windows and then SSH into the VM on my PC from PuTTY
Open browser on my host OS and type
https://serverip:port, whereportis the port no. of Portainer in my VM serverTake out my laptop and open browser and do step 3 to open Portainer
Take my laptop and go 10 km away from home and do step 2 and 4
The last step will come later but right now none of them are working. Any suggestions?
