How to create an SSH tunnel between Ubuntu Server (Virtual Machine) and Mac OS 10.8.5 - macos

I want to create an SSH tunnel between my virtual machine (Ubuntu server 12.04) and my MAC OS, the main thing is i want to access to the Ubuntu server from an external machine without
i have the IP address for the Ubuntu Server : 192.168.248.132
and the IP address of the MAC os : 172.20.3.90
I can access form the mac os to the Ubuntu server, but i want to access to the ubuntu server from an external machine.

Which VM you using?
You should create Network interface called Bridged Network - for VM Ware.
This way your Ubuntu will get real IP from local DHCP server - router in your case.
So IP become 172.20.XX.XX.
This should be enough to be accessed from local network.

Related

Can't access my flask app running on my virtual machine

I'm running a Ubuntu 18.10 LTS virtual box on my Windows 10 system.
In the network configuration I set the network to bridge.
After that my virtual machine appears in my local network with the ip 192.168.0.231.
A ping from my hosting system to the VM works fine.
I'm then starting a flask app with DEBUG=TRUE, TEST=TRUE, SERVER_NAME=127.0.0.1:5001. On the VM the server starts and is available under localhost:5001.
But from my hosting service I get Could not get any response, when I try to access 192.168.0.231:5001.
Do I have to open some ports on the VM?
Thanks!
You need to:
Start the VM with the port forwarded and be sure it is not used on your Host OS
use when starting the app --host=0.0.0.0 if you start it with flask run

Accessing Host machine urls from Ubuntu VM

I have an Ubuntu VM on my windows host machine. I have installed Hashicorp consul on my windows host machine. I am trying to run docker container and trying to access the consul url from the VM using ip. But I am unable to do so.
Is there a way where I can access any host machine url from the ubuntu virtual machine. I am not able to access any url of app deployed on host machine from vm.

Access Docker container running on OS X via boot2docker in Windows virtual machine

Overview:
Host: Mac OS X running boot2docker and Docker
Guest: Windows 7
The Problem:
For my web-development I have set up a docker container via boot2docker on OS X. Within OS X I can access my docker services via boot2docker.
Running boot2docker ip, I get:
The VM's Host only interface IP address is: 192.168.59.103
I am running a Django application on port 1234 (I have mapped the port 5000 on the docker image to port 1234 on my Mac) which I can access within OS X in an web-browser via the address 192.168.59.103:1234. Everything works fine in OS X.
Now I have to test the Web stuff on IE which is why I have downloaded IE8, IE10 and so forth via Microsofts modern.IE website. As a result I have some more VirtualBox images, which are running Windows 7 and come with the propriate IE version.
The question is now how to access the Docker container in those Windows instances to test it under several IE versions.
What I have done so far:
Idea 1
To access the Django application I have looked up my local IP address and tried to access it via NAT in the Windows guests. Given my local IP adress 192.168.178.24, I have tried to access 192.168.178.24:1234 from Windows. Although I can ping 192.168.178.24 from Windows, I do get only a timeout on the port 1234.
Idea 2
Boot2docker runs a VirtualBox machine called boot2docker-vm. It comes with two network adapters, NAT and a host-only adapter called vboxnet0. The latter has the address 192.168.59.3 (which is the one which boot2docker ip returns) with the network mask 255.255.255.0. It runs a DHCP-Server on Server Adress 192.168.59.99 which gives addresses from 192.168.59.103-254.
I have added a second network adapter for my Windows guest systems which can also access via a host-only adapter the network vboxnet0. When being connected to the network the Windows machines do get a valid IP and can ping the IP 192.168.59.103. But I cannot connect to my Django instance on port 1234. If I try to call 192.168.59.103:1234 within Windows, I get a timeout.
Why is it not possible to connect to the Django instance? Can you help me? Thanks in advance.
I have found a solution to my problem here.
To get access to the Django instance I had to open the port on the boot2docker-vm machine.
This can be done by either by boot2docker-vm → settings → Network → Adapter 1 (NAT) → Port Forwarding and add a new rule where Host IPand Guest IP can be left empty and Host Port and Guest Port should be set to 1234.
Another way to do so is executing the following command in the command line
VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port1234,tcp,,1234,,1234";
Of course this needs to be done for all ports, if more than one port is being used.

Unable to read from Guest OS in VirtualBox. Host: Windows 8, Guest: CentOS 6

I'm hoping to have a situation where I can write code in the CentOS guest, and have it presented to me in a browser under the host OS. I'm currently using Windows 8 as my host.
My current network settings, and...
When typing ifconfig into the guest.
All I want to is to be able to get PHP code that is in /var/www/html on the guest machine, and have it show in the host machine's browsers. Suggestions?
Maybe you should give a look at Vagrant, a tool that allows you to replicate development environments on a guest machine and run the applications on your host's browser by opening a port that gives you access to localhost of the guest machine.
You can even edit the code in your host vm, but all the dependencies of the project are hosted by the guest vm.

Access virtual host from guest os ( oracle virtual box)

I am using ubuntu 11.10 and have installed different virtual host on different ip like
127.0.0.2 www.example.local
127.0.0.3 www.wordpress.local
... etc
I want to test these website in IE9, for this i have install windows7 in oracle virtual box and also modified host file of windows7 and add this line 10.0.2.2 localhost at the end of the file and also create a new bridge adapted.
After all this setup i can access localhost of ubuntu from windows7, but find problem while accessing virtual host of ubuntu.
Please help me to access these virtual host on windows 7, i have already search google, ubuntu forum and stackoverflow for this but didnt find right answer.
If I understand you correctly, you want the virtual adapters ip, ie. the gateway ip.
Just add those lines you have added to Ubuntu's host file to the host file in your Windows 7 VM, replacing 127.0.0.x with 10.0.2.2 should make your Windows VM connect to your Ubuntu host for requests to those hosts. This should usually sufficient, unless your HTTP server is configured to serve www.example.local only for connection to 127.0.0.2 and similar for www.wordpress.local.

Resources