Is it possible to access a localhost from a vagrant devbox? - node.js

I'm running my application on a local Vagrant VM on my computer and I was wondering if I created a node server that ran on localhost (also on my computer) would I be able to access the node server from my Vagrant application ?

With default vagrant settings, you can reach your host computer via the IP 10.0.2.2. This is at least true for the VirtualBox provider. I haven't tested others so far.
If you have configured your node server on the host machine in way that it listens to all IP addresses assigned to your host computer you should be able to access
http://10.0.2.2
from within the vagrant virtual machine.

Related

Docker Xdebug LAN / Public Dev server

I want to get Xdebug running in a semi secure manner over LAN in the office. Our current setup is as follows:
Local server on LAN network under 192.168.1.1 with Ubuntu Server 16
Multiple instances of docker with PHP / Apache running on Ubuntu server
Jwilder nginx proxy for forwarding all requests to individual docker containers
https://github.com/jwilder/nginx-proxy
Files are directly edited over an internal SMB share where Windows hosts connect to the Linux share. These are the hosts running PhpStorm.
The machine is exposed to the world using port 80. LAN has access to all ports.
I'm at a bit of a loss how to properly setup Xdebug using PhpStorm where only those within our LAN can trigger the debugger and debug from map files from a Linux host on Windows.
A DBGp proxy would be the answer here.
It limits all debugging connections from the web server to a single host inside the LAN.
It allows you to perform multi-user debugging with the help of IDE keys.
JFYI, in Xdebug, it's the web server that initiates a TCP connection to the client (the DBGp proxy in this case), so some Docker networking magic is required here.

How do I install Gitlab on a VM?

I installed Gitlab on a VMWare VM, using NAT, where the VM is running Ubuntu 16.04. Everything installed OK, but I can't access it via the browser. It says I need to configure an external URL. I only need to access the VM from my Mac (where the VM is running). How do I configure a URL so I can access it from my Mac?
Thanks!
When the VM is running locally on the Mac in NAT network config, this means that the ports are available directly on the Mac IP. If you only need to access it from the Mac itself, you could access the application at the port via the loopback (local only) IP 127.0.0.1
If gitlab is running on port 80 in the VM, on the Mac you should be able to access with http://127.0.0.1
If this doesn't work, there are a few options:
Confirm no other service/webserver is running on port 80 locally on the Mac. If there is, you should change the port of the gitlab webserver in your VM, and access using http://127.0.0.1:port
Confirm that port 80 is allowed in the VM firewall, and that the webserver is running https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-gitlab-on-ubuntu-16-04

not able to access virtual machine centos from other computers

I have setup apache on centos 7 vm inside ubuntu host. I can access the webserver my giving ip of guest on the host fine. But, If I try to access it from another computer on the network , it does not work. I cannot even ping to my guest vm ip from other computers.there is no firewall in centos and no selinux.please advise.I am using KVM
Check your route
apache2 restrictions
/etc/sysconfig/network-scripts/ifcfg-??
when you say you can access do you mean when on the host you can access the host? if this is the case can you ping out? alot of info is missing to determine what is wrong
if it is and I am guessing the configuration on the network device make sure to systemctl restart network when you are done

How to access nginx server from host machine, installed on guest VM ?

Host Machine - Win 7
Guest - Fedora
I have installed nginx web server on guest fedora machine and I can access the webpage inside guest machine using the interface address. How can I access the web page from host machine's browser ?
I am using bridged connection.
Router is assigning 192.168.0.16 to the guest machine's interface. I tried same address in my host machine but it doesn't work.
Based on your description:
First you should check your web application's config. You don't mention which type of your web application running on your Apache server, some are launched with the specific ip argment 127.0.0.1( or localhost), so kind of these web application can only be visited on your localhost computer. You should change the ip argument to 0.0.0.0
Second if the "Fisrt" failed, check the connection of the two server(host and your guest) by using telnet.
On your Win7, you can use the command:
telnet ip port
for example:
telnet 192.168.0.16 80
80 is the default port of Apache Http(s) Server.
if the command don't show the "connection refused" error, your Apache server is goood, so it might be something wrong of your web application.
If that, show me your error msg then we go on further.

Cannot access ubuntu server from other machines other than the machine which is hosting the virtual machine which is my ubuntu server

I created a ubuntu server on vmware. I am using it as a file server. I can access it if I am connecting through the machine which hosts the virtual machine. I am not able to do it from other machines which are on the same network. Thanks in advance!
First of all make sure in the setting of the virtual machine that it is in Bridged Adaptor type connectivity.
Give a static ip to the virtual machine using
sudo ifconfig eth0 10.0.0.100 netmask 255.255.255.0
the above is an example. You got what I mean.
3.Third, Try pinging the virtual machine with the base machine running the vbox to make sure they are connected.
ping ipaddress-basemachine
4 . Now if everything is working fine from there then connect with this virtual machine with other base machine using Remote Desktop Viewer or any other similar application.
Specify, the ip-address of the vbox and username, password. It will be able to connect with it now.
5 . If it still is not able to then try to check the firewall rules on both the virtual box machine and the base machine running the vbox using the command
iptables -L

Resources