setting up networking on centos6 virtualbox guest with xp host - networking

I'm using virtualbox and trying to get my centos6 virtual machine onto the network. Virtualbox is running on XP. In the virtual box settings I've enabled network adapter 1, selected the bridged adapter and selected the default hardware. On the virtual machine I've edited configuration files as follows (making sure that the mac address / hardware address matches the adapters mac address from the virutalbox settings):
# cat /etc/sysconfig/network-scripts/ifcofg-eth0
DEVICE="eth0"
BOOTPROTO="none
MACADDR="08:00:27:7D:A8:DC"
ONBOOT="yes"
IPADDR=10.0.20.10
GATEWAY=255.0.0.55
# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=dev.host.com
NETOWRKING_IPV6=no
GATEWAY=10.0.0.55
# cat /etc/sysconfig/networking/devices/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
HWADDR=08:00:27:7D:A8:DC
ONBOOT=yes
NETMASK=255.0.0.0
IPADDR=10.0.20.10
GATEWAY=10.0.0.55
TYPE=Ethernet
When i restart networking I get the following:
# /etc/init.d/network restart
Shutting down loopback interface:
Bringing up loopback interface:
Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization.
eth0 never comes up and obviously I've got no access to / from the network.

There was a rule in /etc/udev/rules.d/ that was associating an old mac address from the cloned machine with eth0. I edited the rule (/etc/udev/rules.d/70-persistant-net.rules), to use the new mac address virtualbox generated when I enabled the network adapter.
eth0 is up and running - I can access the network. (thanks to the centos forum).

Not sure about this behavior in other Cent OS version or Linux distros but in Cent OS 6.1, /etc/udev/rules.d/70-persistant-net.rules is automatically generated by the OS and after a couple of reboots, it will be regenerated based on the Mac Addresses in the ifcfg-eth* files.
So I didn't have to edit the file. I just had to reboot the VM a 1-2 more times.

Device eth0 does not seem to be present, delaying initialization.
This is quite a generic error for a number of issues. UDEV can work often however renaming the NIC itself among other solutions such as specifying the HW address will work too. But that's not all of them. Give this older post a try. Looks like a collection for a bunch of solutions to this error:
Device eth0 does not seem to be present
Regards,

Always check the file format of ifcfg-ethX was not modified by a Windows editor. In case the line ends are in windows format, you will encounter the same problem.
This cause is hard to notice and the error message is misleading.

Related

Is it possible to make "WSL" virtual switch external in Windows 20H2 (WSL2.0) and how to configure it?

It's not enough for me to bind WSL ports to localhost because I need to run applications in WSL which must be run in and from my local network. Attempt to switch WSL virtual switch to external in Hyper-V manager leads to Access-denied error (when wsl instance is running) with following big problems with host's and/or WSL's network as a result until I reboot the host. When WSL distro is not running WSL virtual switch is invisible in Hyper-V manager (Virtual switch manager).
I have 2 question and will be very appreciated if someone could help me with that:
Is it a normal behavior - having got problem with network attempting to configure WSL virtual switch directly? As I recall there were no such problems with Hyper-V virtual machines - maybe just short losing of connectivity, not more.
Is there a way to configure WSL such way so it starts with WSL external switch any time I run it? Files .wslconfig and /etc/wsl.conf look to be useless for this - I haven't managed to find the solution in google.
Yes you can convert it to external from Hyper-v Manager. Just start the Hyper-v Manager as Administrator
It is indeed possible to get this configuration to work with IPV4. This is quite tricky, as you need to act on the Network configuration to set an IP address in the external network, and this requires systemd to be enabled.
Install WSL and Ubuntu distribution
First ensure that you have WSL2 installed, and install it if this is not the case
https://learn.microsoft.com/fr-fr/windows/wsl/install
WSL documentation:
https://learn.microsoft.com/en-us/windows/wsl/
It is key to have Ubuntu installed for WSL2, as the KDE installation is not compatible with WSL1.
wsl --install Ubuntu-20.04
It is important to have a recent version of WSL (1.0 as of this writing), as it allows you to use systemd.
Configure networking
By default, WSL installs with NAT and a dynamic IP which changes each time WSL is restarted.
There are also very limited options to access network services brought by WSL, as only TCP ports can be proxied with netsh, not UDP ports. This causes all sorts of issues with X, as it is using UDP ports, and I have been totally unable to make X windows desktops work, despite HOWTOs online claiming success.
If you need additional tools, now is the time to install them, as you are going to lose network connectivity for some time.
apt install net-tools
Change from internal to external network (Hyper-V manager)
You need to open Hyper-V manager and go to the virtual switch management. There is a WSL switch which by default is configured as “Internal network”. You need to change it to “External network”.
You also need to select which physical adapter you are going to connect to, Ethernet or Wifi.
At this point and until you finish network configuration, you no longer have any network connectivity.
Your virtual network card is now connected to the external network, but it is not configured, which we are going to do now by means of systemd.
Configure you virtual network card
From within WSL, edit file /etc/wsl.conf so that it contains:
[network]
generateResolvConf = false
[boot]
systemd=true
Create a file named /etc/systemd/network/26-fixed-ip.network containing (example):
[Match]
Name=eth0
[Network]
Address=192.168.1.60/24
Gateway=192.168.1.1
DNS=192.168.1.30
Select a fixed IP address in your external network range, and adapt the above parameters according to your case.
Configure DNS resolution
We have already instructed WSL not to generate resolv.conf each time it is started, as seen above.
It is now time to configure /etc/resolv.conf to contain:
nameserver 192.168.1.30
nameserver 192.168.1.5
domain xxxxxxxx.net
Check connectivity
Stop and start wsl (from a Windows cmd prompt):
wsl --shutdown
wsl
When wsl is restarted, it gets the fixed IP address, instead of a random one. You may ping any IP address and it works. You may also ping your ip address from another host on your LAN:
ping 192.168.1.60
Yes you can, but it seems to work only in IPv6 in my situation:
When I ran wsl --shutdown and opened Hyper-V Manager, the WSL switch appeared in Virtual Switch Manager, and can be successfully changed to external.
However, the IPv4 address could not be changed, and it's unable to access the Internet via IPv4 either. So I have to assign a NAT IPv6 network (fd68::/64 in my case) to make it work.
Maybe you should do some repair to your system if you can't reproduce this.
Note: if switch WSL is changed to external, your main adapter will become vEthernet (WSL) or something similar.

CentOS 6.5 Network Configuration

I've been trying to install CentOS 6.5 on a computer at work for the past couple weeks, but I'm getting stuck at configuring the newtork. I can't get an IP via DHPC. If I setup everything to be static, I get the network icon but not network at all (I can't even ping the gateway).
Maybe I'm missing something? It's a fresh install, and I have trying editing the network-scripts manually and also via the network manager tool. None seems to work, but it all works fine on my Windows computers, even with DHCP.
The router is at 172.16.0.100, subnet 255.255.255.0 and the computer IP could be anything, but I'm using 172.16.0.1.
As root what is the output of ifconfig?
This will display what networking devices have been configured by the system and what the status of them is.
service NetworkManager start;
chkconfig NetworkManager on
ip addr
or
ifconfig eth0 #ip up
or install and use webmin

VMWare Fusion 6.0.2 Network Bridging is allowing only certain specific traffic

I am using OSX Mavericks and VMWare Fusion v6.0.2.
I am running two Virtual machines, one Windows 7 Pro, and the other Debian Sid.
I do not wish to use NAT networking through the Host, I prefer to have the VMs sitting directly on the network, but I am having a problem getting the bridged networking functionality of VMWare Fusion working correctly. I have set the VMWare Network preferences page to Bridge the VMs to the Mac internal WiFi adapter.
Both VMs can ping the router, and they both get valid DHCP assigned IP addresses for the LAN. They can both connect to the Internet over the network bridge and browse and download files.
My problem is when I wish to communicate between the VM->Host, Host->VM, or VM->VM over other ports. For example if I try to SSH from OSX Host to the Debian VM, the request times out. The Windows 7 VM has a SQL Server running on it, but I cannot connect to it from the OSX host, or from the Debian VM. The Debian VM has a xsp4 web-server running on port 8080, but neither the OSX host nor the Debian VM can access it.
I can ping from Host->VM, VM->Host, and VM->VM with no issue, they can all see each other on the network, and the OSX host is sharing network folders to the Windows 7 VM without a hitch. It seems like it is allowing some communication, such as DHCP requests, Ping requests, Windows Network Shares, and Web Browsing, but is not allowing anything else.
I have turned off the Windows Firewall, OSX Mavericks firewall is turned off, and the Debian VM doesn't have selinux or iptables firewalls installed.
I have found several similar question threads while researching this problem, but a lot of them are for much older versions of VMWare Fusion, or are for VMWare Workstation which has different network preferences.
I can get these scenarios working to a degree if I switch VMWare's network settings to use NAT instead of bridging, but that messes up the IP addresses of the VMs, I want to keep them on the same network.
For what its worth, I did eventually come up with an answer for this.
There are two different versions of VMWare Fusion 6.x, Standard and Professional.
I was using the Standard version.
I changed the licence for a Professional licence, which allows you to add new network configurations in VMWare Preferences (and other cool things like that).
I added a new network with the default options, then assigned all of my VMs to that new network interface. I also turned on Promiscious mode in settings, but that might not have changed anything.
I then rebooted the VMs, set them up correctly to work on their new IP addresses, and Lo and Behold, I was able to establish connections between VM->Host and VM->VM. Exactly what I wanted.
I realize that this post is several years old, but since I had such a hard time with an issue similar to this, I wanted to post my answer as well, though I am not positive it really solved my issue. No problems still.
My setup:
MacBook Pro (Retina, 15-inch, Mid 2015)
OS X El Capitan
My problem:
In order to allow me to clone my private school git repository using ssh keys, I have to run a bridged network connection for my Windows 10 Eduction VM using VMWare Fusion.
What I've Tried:
http://www.kapilarya.com/windows-sockets-registry-entries-required-for-network-connectivity-is-missing
https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1016466
And several other blog posts and forum replies, all attempting to do somewhat the same thing.
Answer:
After numerous attempts to reset just about everything you could, I took a step back and brainstormed. Then I thought, if my host machine (Macbook Pro) could connect wirelessly to the internet, this bridged connection should still work. I checked the Network Adapter's MAC Assigned to the VM's Network Adaptor and it was different from my host computer's wifi address (MAC Address). I then entered my host machine's wifi network address (MAC Address) in as the effective MAC Address for the Windows VM Network Adaptor and..voila, internet.

use dnsmasq to point .dev domains to one computer from all local networks to which it is connected

I'm running Apache etc (actually MAMP at the moment, but soon to be replaced by individual Apache, PHP, MySQL...) on my Mac, for testing my websites locally/offline.
I want to be able to test all my local sites (domains *.dev) from any and all of the following, without having to update the hots file on each device (some of which, such as un-rooted phones, don't even allow editing of the hosts file):
Obviously, my Mac itself...
Any device on any local network to which my mac is connected (My Mac doesn't necessarily always have the same IP address)
Any virtual machine running on my Mac (in Parallels) – primarily, various versions of Windows (my Mac does always have the same IP address on Parallels Shared Networking)
Now, I read that dnsmasq may be able to help, and have installed it on my Mac using Homebrew. I set it up to start on startup, and my dnsmasq.conf reads as follows:
address=/.dev/127.0.0.1
This has the effect of allowing any domain *.dev to work on my Mac itself, which is a start.
Next I tried to make it work in a Parallels VM by setting the DNS server to be the local IP address of my Mac. However, this doesn't work – because dnsmasq returns 127.0.0.1 as the IP for any lookup for *.dev, but of course this makes the VM look for the site on the VM itself, rather than on my Mac... which obviously doesn't work.
So I'm a bit stumped. Can anyone give me any tips? Is there a way to set up dnsmasq to do what I want, or should I be looking at another method?
Thanks!
I don't have any experience with Parallels but with Virtualbox you can set up a bridged network connection. I presume Parallels has something similar. This will set up an internal network (e.g. on 192.168.1.*) and you can probably assign fixed IP addresses to that. Like this you can give the Mac a fixed IP address which you can also use in your dnsmasq configuration - but you might want to have two TLDs for this so that .dev can keep pointing to 127.0.0.1 while .devel points to 192.168.1.xx.

Connect to server in vmware player while host is not connected to a network

I am using VMWare Player 3.1.0 on Host OS Windows 7 Professional 64-bit. My guest is is SUSE Linux ES 10. My guest OS (SUSE) runs JBoss App Server which I access from host using HTTP. I used a "Bridged" connection to set up all this.
My problem:
When I am connected to network on the Host (using wired network adapter) I can connect to the http server on the Guest OS and browse the application. However, when I am disconnected from the network on Host (unplugged the wire), I cannot access to the guest OS app server and browse the application. I use the guest OS ifconfig command to find out ip address of the guest OS. This ip address does not change whether connected or disconnected. I have even tried using Wireless Data card, but that does not work either.
I have tried "NAT" as well as "Host Only" connection and rebooted the guest but it does not work either. I think for some reason the guest OS can only recognize the physical network card (which is disconnected).
I need to run this machine (my laptop) independently of the network because I use this for demo and need to be able to connect from my host OS to Guest OS.
I am not sure I understand exactly what you are trying to do, but I do know setting up a working NAT configuration will offer you the most flexibility.
Click the networking icon and select settings, Select NAT.
Follow these steps on your Unix OS
cd /etc/sysconfig/network-scripts
Make a backup of your ethernet adapter configuration
cp ifcfg-eth0 ifcfg-eth0.bak
Next modify the settings to look like the following:
DEVICE="eth0"
BOOTPROTO="dhcp"
HWADDR="What ever was here on your system"br/>
NM_CONTROLLED="yes"
ONBOOT="yes"
Save your changes
Restart your network adapters
/etc/init.d/network restart
Try nslookup www.google.com
You should now be able to connect back and forth from your Windows Host and Linux guest.
theJay28
-p.s. I had screenshots, but I do not have the 10 points yet to post images.
I figured that the solution is to restart the VM after making the changes to the NetWork setting on the VMWare. I selected Network for the VM as "Host Only" shutdown the VM and started it again. After that I was able to do what I wanted to do (i.e. browse the web application on guest from the browser in the host machine) without connecting the host to the network.
So key to the solution in my case was to make the network changes and restart the VM.
Any comments suggestions welcome...

Resources