Page 1 of 1

Problem with accessing server

Posted: 14. Apr 2017, 11:47
by Rcls
I have a Linux Debian installed on Virtual Box. I have a Windows 10 host and I'm using the virtual machine to host my MySQL database for local development. I also have Apache installed for PHPMyAdmin. I can randomly access the server using the ip address 192.168.56.101 (sometimes after starting the machine, other times I have to reboot multiple times to get it working).

Recently I've had major problems gaining access to the server, through the ip address. It seems to work completely random. To be clear: I have very little knowledge of networking.

I have two network adapters set up:

Adapter 1

Code: Select all

Atatched to: Bridged Adapter
Name: Realtek PCIe GBE Family Controller
Adapter Type: PCnet-FAST III (Am79C973)
Promiscuous Mode: Allow All
Cable Connected
Adapter 2

Code: Select all

Atatched to: Host-only Adapter
Name: VirtualBox Host-Only Ethernet Adapter
Adapter Type: Intel PRO/1000 MT Desktop (82540EM)
Promiscuous Mode: Deny
Cable Connected
I've manipulated the /etc/network/interfaces to add a static ip for Linux:

Code: Select all

auto eth1
iface eth1 inet static
address 192.168.56.101
netmask 255.255.255.0
I've also tried to change from eth1 to eth0. Doesn't have any effect. I can see the IP address with command ip addr, but it doesn't work. It won't respond.

However, eth0 ip address does respond BUT it keeps changing every x minutes. I don't know why this happens.

What can I do to get a static IP address working properly to access from host every time I start the virtual machine?