connecting to my local virtualized debian - networking

I have installed Debian as a VirtualBox guest on Windows XP. Now I have installed ssh and apache on this virtualized Debian yet I couldn't find a way to connect. I have already tried "10.0.0.2", "10.0.2.2" and inet addresses I get from running "ifconfig". (I can get the "it works!" page of apache2 when I try 127.0.0.1 under guest Debian.
I will be greatful for any tips

You're going to want to refer to section 6.4.1 of the manual to set up port forwarding with the default NAT setup.

Related

Cannot see initial page from nginx in other computers in same LAN on Fedora 35

I have installed it with command "sudo yum install ngingx" and its visible from computer host using its own ip in the browser, but in other computer in the same LAN and resolving ping it doesnt work and answers a timeout error. I know there is a /etc/nginx/nginx.conf file but I didnt see any valid configuration to resolve this (or I didnt search very well).
Machine has internet and resolves ping to other machines in lan
Could somebody guide me?
I use virtualbox to run Fedora
Thank you, here I left nginx.conf enter image description here
First of all, are you using bridge mode in virtualBox? If so and this is still not working, check if Fedora has enabled the firewall by typing in a shell:
systemctl status firewalld.service
If active, check the zone where the main adapter is configured
firewall-cmd --get-active-zones
Add ports 443 and 80 to the zone related to your interface (for instance FedoraWorkstation)
firewall-cmd --zone=FedoraWorkstation --permanent --add-port=80/tcp
firewall-cmd --zone=FedoraWorkstation --permanent --add-port=443/tcp
This should do the trick
Finally the problem was that apache is installed by default in fedora workstation and main page of nginx was showing apache as current web server, so any changes made in nginx wasnt being loaded. Solution: purge apache from system and reboot. Now nginx load as the main web server and changes made are applied

Set GITLAB to be accessible on LAN

After many research i have not found anything...
I install GITLAB on a CentOS VM. The CentOS ip address is 192.168.100.1.
In the file /etc/gitlab/gitlab.rb, I modified the line:
external_url 'http:192.168.100.1:1234'
I executed the command 'gitlab-ctl reconfigure' and no errors appeared.
When I use Firefox, and I can access to my Gitlab with all the Centos' interfaces:
192.168.100.1:1234
127.0.0.1:1234
It is normal because when i execute 'netstat -ntlp', I can see:
tcp 0 0.0.0.0:1234 LISTEN 22222/nginx:master
What is the problem?
I cannot access to GitLAB outside from the same Network 192.168.100.1/24.
From an other VM on the same network (192.168.100.2), i can ping '192.168.100.2'. I also make an ssh connection but if I made a:
curl 192.168.100.1:1234
The result is "Time out"
Thank,
Vincent

Unable to access jupyter notebook on virtualbox guest through browser in windows host

I have virtualbox 6.1 running a ubuntu 20.04 LTS guest on a windows 10 host.
I ran a jupyter notebook on the ubuntu guest. and it gave me this output
http://localhost:8888/?token=749e04f283016d.......
or http://127.0.0.1:8888/?token=749e04f283016d.......
I got to know that I have to setup host-only adapter to access the page on windows 10 browser so I have setup host-only adapter along with NAT adapter for the ubuntu guest.
accessing-your-virtualbox-guest-from-your-host-os
Post that I took the host-only adapter interface IP address using ip a command in ubuntu guest and I am able to ping guest from host as well using that IP. But when I replaced it in the above url, I am still unable to access the link and browser running on windows host says ERR_CONNECTION_REFUSED.
What additional setup should I do to access the jupyter page from windows host.
I figured it out from the following post which tells the same thing about ipython notebook
Install IPython on Ubuntu 12.04 VirtualBox Guest and use it from the browser on the Windows Hostenter link description here
and finding out from this answer the main difference between jupyter and ipython notebooks.
What-is-the-difference-between-Jupyter-and-IPython-Notebook
The key thing to note here is that many applications when started eg. mongodb are accessible only on loopback interface IPs(localhost, 127.0.0.1) only. the reason being to avoid exposing by mistake any application on public IPs which u might have installed for testing, etc. So, in this case all you have to is generate a config file for jupyter server using :
jupyter notebook --generate-config
which will generate config file :
~/.jupyter/jupyter_notebook_config.py
where you have to change the following line:
c.NotebookApp.ip="localhost"
to
c.Notebook.ip="0.0.0.0" #for all IPs
Now run the jupyter notebook again and you will be able to access it on your host and even any interface IPs for any adapter you have setup for your guest OS.
A few things to review when running Jupyter inside a virtual machine.
Make sure you have added the Jupyter's port (i.e., 8888) to your Ubuntu firewall
sudo firewall-cmd --permanent --add-port 8888/tcp
sudo firewall-cmd --permanent --add-port 8888/udp
sudo firewall-cmd --reload
When using VirtualBox you should map ports to the VM.

Centos VM with Docker getting host unreachable when trying to connect to itself

I have Docker running on a Centos VM, with bridged network. running
ifconfig
shows that my VM gets a valid IP address. Now I'm running some software within a docker container/image (which works within other docker/networking configurations). Some of my code running in the docker container uses SSL Connection (java) to connect to itself. In all other run configurations, this works perfectly. But when running in bridged mode with Centos VM and docker-compose, I'm getting an SSL Connect exception, error: Host unreachable. I can ping to and ssh into the VM with the same IP address and this all works fine. I'm sorry that I can't post actual setup/code and scripts as it's too much to post and it's also proprietary.
I'm baffled by this - why am I getting Host Unreachable in the aforementioned configuration?
FYI, I resolved the problem on centos by using the default "bridged" containers provided by Docker, but adding the following to my firewalld configuration:
firewall-cmd --permanent --zone=trusted --add-interface=docker0
firewall-cmd --reload
service firewalld restart
You might also need to open up a port to allow external communication, like so:
firewall-cmd --zone=public --add-port=8080/tcp --permanent
My solution was to switch to an Ubuntu VM, because switching my docker compose to the default "bridged" network broke my aliases, which I really needed
The only remaining question here is why after configuring firewalld, a user-configured network on docker-compose cannot access the external IP, forcing us to switch to the default bridged network

RDO packstack : losing IP connectivity during installation

I'm trying to install Openstack Mitaka via RDO packstack. I'm following this tutorial. It completely alligns with the official doc.
I'm making sure that I have internet connectivity and that my hostname is resolving (by putting it in the /etc/hosts file). When I install Openstack via packstack --allinone, I see the puppet scripts executing but after a while it hangs.
When I then try to ping my Centos machine it fails. I have no clue why this is as I verified the ping worked before I started the install. It must happen during the packstack installation process.
I have tried now 4 times, reinstalling Centos and Packstack and the behaviour is consistent. I'm running on Virtualbox and my network is in Bridge mode.
Any ideas?
I found out that packstack during installation changed my IP address. Not sure why or how, but it was different at some point in time. So the key is to set a static IP address in the /etc/sysconfig/network-scripts/ifcfg-enp0s3 file and also ensure your hostname resolves (by setting it in the /etc/hosts file)

Resources