Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a fedora 12 guest running on VMWare on windows 7. I use it mainly for the occasional linux dev. Whenever I restart the guest, networking works fine. But if I close the VMware player and save state, the next time I start the image, networking is disabled (red x on the network icon. message saying networking disabled). I can't seem to find a way to restore networking. I have to reboot the guest to get my network access back again. My Ubuntu image doesn't have this problem. I can close the player and when I re run the image, I can pick up where I left off, with all the open firefox windows and application windows as I left them. Fedora saves state, but doesn't seem to enable networking.

There is a relevant warning I have seen "SELinux is preventing /sbin/ifconfig "read" access to/var/run/vmware-active-nics." But I am not sure how to solve it.

I know fedora isn't officially supported by VMware, but it seems to be working fine for the most part and meeting my needs, except for this one little issue.

Any help would be much appreciated.

share|improve this question

4 Answers 4

Have you tried "disabling" and then "enabling" networking via the network icon?

share|improve this answer
    
I can't. When I click on the network icon, the only option "networking disabled". I can't enable it from the "network center" either. –  Chaitanya Oct 9 '10 at 22:37
    
How about via the "ifdown" and "ifup" commands? –  user48838 Oct 10 '10 at 0:32

Do you have vmware tools installed on the fedora VM? Do that first and try it.

My experience with SELinux is that it causes me more problems than it solves. I disable it as one of the first steps that I do on a new box.

share|improve this answer
    
Yup. I have vwware tools installed. Turning off SElinux didn't make any difference. I did it by editing the /etc/selinux/config file –  Chaitanya Oct 17 '10 at 10:15

Try running setenforce 0 as root before saving the state and running setenforce 1 after restoring. If this works, then read the Troubleshooting section of the Fedora SELinux Guide.

share|improve this answer

I'm having the same or a similar problem on a CentOS 6.2. VMWare virt running on a Mac OSX 10.6 host.

After booting up, the networking is fine. After suspending and resuming, routed shows no routes, and ifconfig shows only the lo device, and restarting networking behaves as though there is no eth0 device. SELinux complains about ifconfig having tried to read /var/run/vmware-active-nics, but no such file exists at that point.

If I reboot, everything is fine, but that file is not there. If I touch that file, then run restorecon -v on that file, then suspend and resume, everything is fine.. except that after either rebooting or suspending and resuming, that file is gone again, and the next time I suspend and resume, I get the networking failure and the SELinux complaint again.

Something that happens at boot and resume time is unlinking that file. vmware-tools-distrib is installed. I tried reinstalling it, but that didn't have any affect.

Running setenforce 0 before suspending doesn't seem to have any affect, I still get the SELinux complaint.

I was running this same setup without having these problems, except SELinux was disabled, and I was running Centos 5.8.

Edit - fixed this by altering the SElinux policies as follows:

grep ifconfig /var/log/audit/audit.log | audit2allow -M mypol semodule -i mypol.pp

Before running semodule, I looked at the generated mypol.te file:

module mypol 1.0;

require { type ifconfig_t; type initrc_var_run_t; class file read; }

#============= ifconfig_t ==============
allow ifconfig_t initrc_var_run_t:file read;

(Kind of a hack, with that policy module name, but. It's a break-fix measure until vmware-tools does something better, I guess. If I have to making policy changes for other things, I'll revisit the name.)

Edit #2 - wasn't fixed after all, more tweaks were required:

I could've sworn it was working, but this morning when I resumed, eth0 failed to come up. I edited /etc/vmware-tools/resume-vm-default, and commented out the line that removes the /var/run/vmware-active-nics file. That seemed to help at first, but after multiple suspend-resumes, it didn't. Or maybe it was after shutting down vmware that it didn't. Anyway, doing that made it some after resuming, that file is still there, so I could run that script manually and see it's output, where upon I found that it was saying that eth0 wasn't managed by NetworkManager. Not sure what that's about, but restarting the NetworkManager service fixes it until the next time I resume. So I added a line to resume-vm-default that says

service NetworkManager restart

Now I can suspend the virt, shutdown VMWare entirely, start it back up, and resume the virt, and eth0 comes and connects up.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.