Hello everybody.
I'm playing with VMplayer in a PC inside a corporate LAN. My host OS is Windows XP Pro. My guest OS is Linux Fedora 7.
My idea is to learn Linux with a VM, and explore its capabilities in an embedded software development environment, while being able to access the LAN resources (printers, Windows file servers and Internet access).
If I select ethernet0.connectionType = "nat", I can access Internet from the guest OS (with Firefox, for instance), but I cannot access any local file server, except the host OS side of my PC (I can see its Windows name and workgroup, and access its files via Nautilus, for instance).
If, on the other hand, I select ethernet0.connectionType = "bridged", I can access Internet
from the guest OS, and also all the local file servers in the LAN, but it uses an IP leased from the LAN DHCP server to access the LAN.
In this LAN, every PC (mine included) uses a static address (or even several static addresses). The leased IPs are reserved to "external" PCs that happen to connect from time to time, so I don't want my PC to use a leased IP for my VM. Is it possible to force VMplayer to use a specific static address to access the LAN? How? Alternativily, can I use "nat" to access the LAN? How?
Perhaps the following data will help to understand my problem:
Host OS (Win XP):
- 1 NIC
- IP addresses (both static): 192.8.100.105 / 255.255.252.0 and 10.191.2.65/255.0.0.0
- Default gateway: 192.8.100.12 (this is the gateway to Internet)
- DNS server: 192.8.100.66
- IP address (DHCP) as used by VM in briged mode: 192.8.102.117 (as seen with Whireshark, for instance)
Relevant entries from vmx file:
config.version = "8"
virtualHW.version = "4"
guestOS = "other26xlinux"
displayName = "F7-Develop"
numvcpus = "1"
memsize = "596"
MemAllowAutoScaleDown = "FALSE"
MemTrimRate = "-1"
...
ethernet0.present = "TRUE"
ethernet0.virtualDev = "e1000"
ethernet0.connectionType = "bridged"
ethernet0.addressType = "generated"
ethernet0.generatedAddressOffset = "0"
ethernet0.generatedAddress = "00:0c:29:c6:71:de"
virtualHW.productCompatibility = "hosted"
Thank you for your time.
Is it possible to force VMplayer to use a specific static address to access the LAN?
Yes, it is possible.
(I happened to have just done this very thing.)
In the Guest OS, you must disable DHCP on eth0 and set up static IP.
Of course, this is Linux and you're trying to learn it, so you have a chicken/egg thingy.
TWO ways to do it:
1) Linux GUI
2) The Linux command line
.
.
Boot Linux guest
Log in to the Linux desktop as "root".
1) GUI
StartBar/System/Admin/Network
Select eth0, then click the Edit TAB
Make the following changes:
On Devices TAB:
select eth0 and click edit button at top
check Activate device
uncheck Allow users
uncheck IPv6
click Statically set IP
(this de-selects "Automatically obtain IP")
enter IP/Mask/Gateway
OK
Now click the DNS TAB
Enter correct info there.
File/Save then File/Quit
(you must restart to enable changes)
2) command line
You would make the above changes by editing the following files:
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/networking/profiles/default/ifcfg-eth0
/etc/sysconfig/networking/profiles/default/resolv.conf
/etc/resolv.conf
(you must restart to enable changes)
Finally, in either case,
You must restart the network or reboot to effect the changes.
So, launch a "Terminal" window:
Typically,
StartBar/Applications/Acessories/Terminal
Then either:
reboot
or
service network restart
hth
bv
> Is it possible to force VMplayer to use a specific static address to access the LAN?
Strange question - VMplayer doesn't set any IPs for the bridged networking at all.
You must tell your GUEST NOT to use a DHCP server and specify the guests IP manually
Is it possible to force VMplayer to use a specific static address to access the LAN?
Yes, it is possible.
(I happened to have just done this very thing.)
In the Guest OS, you must disable DHCP on eth0 and set up static IP.
Of course, this is Linux and you're trying to learn it, so you have a chicken/egg thingy.
TWO ways to do it:
1) Linux GUI
2) The Linux command line
.
.
Boot Linux guest
Log in to the Linux desktop as "root".
1) GUI
StartBar/System/Admin/Network
Select eth0, then click the Edit TAB
Make the following changes:
On Devices TAB:
select eth0 and click edit button at top
check Activate device
uncheck Allow users
uncheck IPv6
click Statically set IP
(this de-selects "Automatically obtain IP")
enter IP/Mask/Gateway
OK
Now click the DNS TAB
Enter correct info there.
File/Save then File/Quit
(you must restart to enable changes)
2) command line
You would make the above changes by editing the following files:
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/networking/profiles/default/ifcfg-eth0
/etc/sysconfig/networking/profiles/default/resolv.conf
/etc/resolv.conf
(you must restart to enable changes)
Finally, in either case,
You must restart the network or reboot to effect the changes.
So, launch a "Terminal" window:
Typically,
StartBar/Applications/Acessories/Terminal
Then either:
reboot
or
service network restart
hth
bv
Thank you, guys. Continuum gave me the right clue, and bobvance gave me the detailed steps in case I couldn't figure it out.