Windows 8 VMWare guest under Ubuntu 16.04 host doesn't have access to the internet - windows

I have Ubuntu 16.04 host machine with WMWare Player and Windows 8 guest. The problem is that the guest Windows machine doesn't have access to the internet.
Host Ubuntu 16.04 configuration:
>>> grep VERSION= /etc/*-release
/etc/os-release:VERSION="16.04.3 LTS (Xenial Xerus)"
>>> sudo iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
>>> sudo ufw status
Status: inactive
VMWare configuration:
> vmware --version
VMware Workstation 12.1.0 build-3272444
Windows guest machine:
Testing:
Notes:
Note the ping is ok and nslookup hangs. Looks like host machine is stopping the traffic.
I tried ssh into host - ok.
I tried ssh into other machine within the Local lo network of the host - ok
The gateway in the network config is set to 172.16.223.2. I tried to change that to the IP of the host (172.16.223.1) - same results.

My case was really simple. For some reason VMWare hasn't picked up proper DNS's of the host and 8.8.8.8 and 8.8.4.4 are blocked within the internal network. Setting DNS servers manually within Windows to the IPs that are allowed within internal network fixed the issue.
I am marking the question as resolved, but if smb posts a solution to fix the VMWare to pick-up the DNS's of the host, I will switch to his answer.

Related

How do I access an Oracle VM in my local network from another device?

I have following setup:
Windows 10 desktop with VirtualBox Oracle VM running
MacBook M1 which needs access to the Oracle VM
Windows desktop and MacBook are on the same local network
From my MacBook i'm able to ping my windows desktop's IP, but not the IP of the VirtualBox VM.
On the Oracle VM's settings I have a bridget adapter configured.
Is there a way to connect from my MacBook to the Oracle VM hosted on my Windows desktop in the same network?
Thanks in advance!
It depends on what type of network adapter you defined to the VM. In order to access from other machines on your LAN, you will need a BRIDGED adapter. Further, you will need to configure it (in the guest OS) with a manually assigned IP address in the same subnet as your other machines. My guess is you just took defaults and have only a NAT adapter.
I've built scores of VM's under VBox, and always create two adapters. The first is a NAT adapter, which allows my vm to access the internet - critical for downloading and installing packages with 'yum'. The second adapter is either HOSTONLY or BRIDGED. I use HOSTONLY if I want the VM to be totally isolated from the LAN and only accessible by the host or other vm's on the host. I used BRIDGED if I want to access the vm from other machines on the LAN. Either way, the BRIDGED or HOSTONLY need to be configured with a manually assigned ipv4 address in the same subnet as the host os.
I always create the NAT as the first adapter, and the BRIDGED or HOSTONLY as the second. On the os, the first (NAT) shows up as 'enps03' and the second as 'enps08'. I then configure enps08 with the following:
First, run the command below to set up the IP address. (substitute your chosen IP, but keep the '/24')
$ nmcli con mod enp0s8 ipv4.addresses 192.168.0.200/24
Next, configure the default gateway as shown - again, the first three octets of your subnet.
$ nmcli con mod enp0s8 ipv4.gateway 192.168.0.1
Next , set the addressing to static.
$ nmcli con mod enp0s8 ipv4.method manual
Set to start on boot
$ nmcli con mod enp0s8 connection.autoconnect yes
To save the changes, run the command
$ nmcli con up enp0s8
Reboot and check with ‘ifconfig’.

Can't ping device through hostname (and avahi installed) from pc

I need to ping and establish communication with an embedded device through its hostname. I'm using the latest buildroot and I enabled avahi and mDNS.
The first problem is that my hostname at startup is always buildroot and the problem is how change my hostname through avahi library and apply immediately on the network.
Can someone help me to configure my device?

How to fix Connection to localhost:5432 refused in postgres installed on CentOS 7?

I have a digitalocean droplet and I'm trying to install my Java web-application, on CentOS 7, which is using postgres database. I've successfully installed Java, tomcat and postgres database. I am able to connect to my droplet's postgres database from my local machine using pgadmin as well as from local eclipse. But when I am deploying the web application on server I'm getting the following error:
org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
I've added listen_addresses = '*' to postgresql.conf
This is the code from pg_hba.conf
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
host all all 0.0.0.0/0 md5
Is there any firewall issue? Do I need to provide any special permission? The port which I am using to connect is 5432. I've not made any changes to the port.
I deleted the droplet and installed ubuntu 18 on it, I was successfully able to connect to the database properly. Again, I installed CentOS 7 and it gives the same problem.
Here's the output of iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 31
For some reason my tomcat 8 server just did that the same thing this morning, when it was working previously. I looked at the selinux logs in /var/log/audit and found the following got me back working again:
sudo setsebool -P tomcat_can_network_connect_db true
Edited: added -P flag to stick between reboots.

Transparent proxy on Mac OS X Lion with Fusion

I have a MacOS X (Lion) with VMWare Fusion installed. In Fusion I have two guests: a Linux and a MS Windows XP. The two guests networking is configured to use NAT thru vmnet8 interface. Both boxes access to the internet just fine by default.
My objective is to force all HTTP (tcp/80) traffic leaving the XP client to be redirected to the Linux client on the proxy port (tcp/8080). The XP client must not be aware of the redirection thus explicit proxy configuration in the XP browser is not an option.
I already tried this setup on a linux host running virtualbox. The iptables nat rules did the trick just fine. But I'm completely lost on how to do this in Mac which is pf based.
I've been attempting to configure a complementary pf.conf (proxy.conf) file with just one line:
rdr on vmnet8 proto tcp from 192.168.190.138 to any port 80 -> 192.168.190.134 port 8080
Concerning the IP: 192.168.190.138 is the XP guest ip and 192.168.190.134 is the linux guest.
I then run the following pfctl commands:
$sudo pfctl -vf ~/proxy.conf
No ALTQ support in kernel
ALTQ related functions disabled
rdr on vmnet8 inet proto tcp from 192.168.190.138 to any port = 80 -> 192.168.190.134 port 8080
and then:
$ sudo pfctl -e
No ALTQ support in kernel
ALTQ related functions disabled
pfctl: pf already enabled
When I attempt to open a webpage on the XP guest pf doesn't redirect the traffic to the linux box. For some reason the pf rule isn't working as expected. Probably because something is missing...

Getting a sinatra app to serve from a vm

I'm running vmware fusion 5 on osx 10.8, my guest OS is Arch Linux, currently I'm able to ssh into the guest os perfectly fine via ssh 172.16.4.191 however when i try a simple sinatra app
require 'sinatra'
get '/hi' do
"Hello world!!!!!!!"
end
ruby hi.rb
2013-04-06 19:45:18] INFO WEBrick 1.3.1
[2013-04-06 19:45:18] INFO ruby 2.0.0 (2013-02-24) [x86_64-linux]
== Sinatra/1.4.2 has taken the stage on 4567 for development with backup from WEBrick
[2013-04-06 19:45:18] INFO WEBrick::HTTPServer#start: pid=426 port=4567
it is not available from my host OS
curl 172.16.4.191:4567
curl: (7) couldn't connect to host
Any suggestions would be great, and of course I will provide more information as needed.
Edit:
Share with my mac is selected, "The virtual machine shares the ip address of the Mac on the external network. The mac provides NAT for network traffic form the virtual machine"
Edit:
I've switched over to bridged mode, and it's now sitting on my lan, i can still ssh into it, still no such luck connecting to my sinatra app.
and the iptables shows no rules
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
You need this line in your hi.rb:
set :bind, '0.0.0.0'
The Document says '0.0.0.0' is the default value. It's wrong.
Just in case anyone is trying to do this on mac / windows 7 with vmware with NAT/sinatra, make sure IIS manager is installed and configured with (connect to server -> localhost:4567).
from my windows browser , localhost:4567/promo_id/ works
from my browser in mac, http://172.16.178.xxx:4567/promo_id/ where 172.16.178.xxx is the IPv4 Address from ipconfig

Resources