How to connect X-Lite softphone from host to guest vm with asterisk? - networking

I am desperate. I've install asterisk on vm 1 (centos) and opensips on vm2(centos), and everything works well so far. Now I need to connect softphone from host to vm1 (to make a call (I'm traying to set up auto-dial out system))) and don't know how to. I use host-only networking between vm's
vm1 - 192.168.56.3
vm2 - 192.168.56.4
host - I've set up rule in firewall, to make traffic enabled between vm's and host, but can't ping from guest to host/ host to guest.

Simplest way - use bridged network to your router.
But host-only also work ok(at least in vmware and virtualbox), check your firewall rules

Related

How do I access my Ubuntu Server installed on Virtual box from anywhere in the World

I am trying to make an IOT using nodemcu and a LED. I want to access the Ubuntu Server(which is installed in the virtual box) through some other network(outside my LAN). How can I do it? I read many articles online, but I am not able to figure it out. I tried port forwarding but it did not work.
I am not sure what I am doing wrong. Is there's a problem in the port forwarding, or I am following a wrong method.
I have installed Ubuntu Server 16.04 LTS on my laptop via VirtualBox. I have installed LAMP. Also, network set to bridged adapter, plus I have dynamic IP
As I logged in, I ran ifconfig. It gave me the inet address as 192.168.16.101
Did you set the VM network interface to be NAT or Bridged?
If it is NAT, then you are essentially double NATTed which means you will need to port forward from your router to the VM host and then you will need to port forward from the host to the VM as the IP assigned will be local to the host machine.
However, the easiest is to set the VM network interface to Bridged.
This will mean the VM will be able access your network directly as it should be on the same subnet as your laptop and appear as another device, which your router will be able to port forward to.

Get IP of VM running on an Ubuntu server configured on bridged networking

I want to set up an exported VM on an Ubuntu Server using VirtualBox on headless mode.
I have the VM up and running and bridged with the ethernet interface of the host (em1), so the dhcp of the host should now assign an IP to the VM if I'm not mistaken.
Is there a way to check if this is working and if yes to get the VM's IP?
Since this is on headless mode so without GUI, the only way to login to the VM is through ssh and for that I need the IP..
welthenwel,
you can do this with VBoxManage.
from a shell, just type:
VBoxManage guestproperty enumerate VM_NAME --pattern */IP
and you will get as response something like in the below image.
now, ignore the fact that I run this cmd from a Windows host, because its behaves exactly the same from inside a linux host
I'm not very familiar with VirtualBox. Bridged with VMWare Workstation meant the IP is given by your default DHCP server, which means you could look up the assigned IP address there (e.g. your router - if you have access to it).
Another option would be a ping sweep of your network segment as I believe Ubuntu doesn't drop ICMP requests.

Vagrant: disconnect NAT from internet on adapter 1 after ssh login

According to 1, NAT on adapter 1 is a hard requirement of Vagrant, otherwise you may encounter ssh problem when vagrant ssh.
Here is what I want: I have a Whonix Gateway installed providing Tor service. The Whonix Gateway stays in a internal network of Virtualbox. And I have a Debian installed via Vagrant. I attached Debian to the internal network of Whonix Gateway on adapter 2 so that it could forward traffic to Tor. Since the default NAT on adapter 1 connects to internet, it is possible that some traffic leaks(not routed by Tor network).
It is possible that I could configure Vagrant to disable internet connection on adapter 1? Or you may have other advice to achieve my goal?

Is VirtualBox NAT networking fundamentally different than VMWare NAT?

I'm trying to debug a problem I'm having understanding the difference between the NAT network adapter in VirtualBox and the NAT network adapter in VMWare Fusion. So far, I can configure VMWare and achieve my desired result, but I cannot achieve this in VirtualBox. In a VMWare VM, I'm able to use a NAT network adapter to achieve the following:
The guest is assigned it's own unique IP address
The guest has access to the outside Internet
The host can ping the guest and ssh to it
The guest can ping the host and ssh to it
The guest can resolve (internal) domain names just like the Host
I thought I saw that this was possible in VirtualBox, but now I'm thinking it's not possible. Perhaps there is some option that is close to VMWare, in which I manually modify /etc/resolv.conf in the guest to match that of the host? I did find a few questions that seem to indicate I should instead be using Bridged mode in VirtualBox, e.g. this question: Can't ping to VirtualBox instance , in which both answers appear to suggest VirtualBox's NAT adapter doesn't support the functionality I want:
It is quite obvious that when you are using NAT it will be impossible to ping host after NAT. It is how the NAT works... even if you will have real not virtual host the bechaviour will be the same.
and
You need to change networking mode from NAT to bridged, and ping should start working in both directions.
Also, answers to this question seem to back up the above: How to ping ubuntu guest on VirtualBox
Is it true that a NAT adapter in VirtualBox cannot be ping'ed from the Host OS?
I have used virtual box for years and I also have 2-3 years experience in computer networking.
Yes, in virtual box you can't ping the guest that use NAT from the host and this also how NAT works in real life. In real life, if you want to be able to contact a host behind NAT, you have to set a port forwarding rules where the connection to a certain port of the router will be forwarded to a certain machine. This must be done on the router.
To enable port forwarding in virtual box environment, select the Network pane in the virtual machine’s configuration window, expand the Advanced section, and click the Port Forwarding button. Note that this button is only active if you’re using a NAT network type – you only need to forward ports if you’re using a NAT (http://www.howtogeek.com/122641/how-to-forward-ports-to-a-virtual-machine-and-use-it-as-a-server/).

How to access loopback adapter from another PC on my LAN

I have installed MS Loop-back adapter and have given it a static IP: 10.10.10.9
my laptop is configured as 10.10.10.30 , and my gateway is 10.10.10.1
i can ping the loop-back NIC from my laptop, but not from any other machine on the LAN. i am trying to beat the 65k port limitation by seeing if i can have virtual IP addresses on one machine and each can then give me 65k ports
thanks.
By very definition, you CANNOT talk to a loopback adapter from any other machine but your own.
If on Linux, you could bridge it to a physical adapter, such as eth0, but why would you want to do that?
Take a look here for setting up IP alias on Windows (disclaimer - I don't own any windows machines, so can't really verify this).
You can ping your Loopback interface from LAN by installing Remote and Routing Access role on the server. After installing the R&S role on the server , configure LAN routing feature. It will start pinging from LAN. I have done this practically in my environment.

Resources