Sunday, October 07, 2007

Ubuntu on Parallels on Mac

I just installed Ubuntu on my Mac under Parallels using these instructions:

How to install Ubuntu 7.04 in OS X using Parallels Desktop 3.0

It seemed to go smoothly. Of course, Ubuntu immediately wanted to download a pile of updates, but that worked ok.

The only problem is that you seem to have to manually turn on the networking within Ubuntu every time you boot it up. The instructions mentioned this, but I thought it was just during installation. There may be a fix, I haven't looked yet. I don't think it's a big deal because normally I just suspend the virtual machines rather than shutdown and restart them. Hmmm... that's assuming the network stays turned on after being suspended, I haven't actually tested that.

Parallels has a pre-installed Ubuntu virtual machine, but the downloads were very slow so I gave up. But I should be able to take the virtual machine I've now created and copy it from my Mac Mini to my Mac Book.

Aside from curiosity, one of my motivations for installing Ubuntu is to get back to working on porting Suneido to Linux. I should be able to do a lot of that natively under OS X but I assume I'll still want to work under Linux as well.

10 comments:

Larry Reid said...

Ubuntu's just Linux, so you should be able to autostart the network. You probably just have to set up the /etc/rc[0-6S].d directories with the files to start and stop the network. Let me know if you don't find anything and I can send you what I have in my Ubuntu Server 6.06.

Now if the network goes away when you suspend the VM, that's another issue. Do you have VMTools installed on the Ubuntu image? I'm not sure if that would be an issue, but I know VMTools is what does a graceful shutdown of Linux when you turn off the VM.

Andrew McKinlay said...

When it comes back from being suspended the network still seems to be connected.

When I tell Ubuntu to shutdown, it doesn't seem to go all the way - you have to stop the VM and Parallels warns that it's still running. But when you restart it seems fine - as if it had shutdown.

I do have Parallels Tools installed.

It's not a big deal since all you have to do is click on the network icon on the top menu bar and pick wired network. Just odd that it doesn't do it automatically. (As it does whenever I've installed Ubuntu on bare machines.)

A little web searching didn't find any solutions.

Larry Reid said...

Darn it! You've got me curious so I just kicked off a download of Ubuntu 7.04 Desktop (I assume you're running the desktop version). I'll install it on a VM tomorrow morning if I have time (not likely) or tomorrow evening.

Stay tuned.

Larry Reid said...

So my Ubuntu 7.04 has a link in /etc/rcS.d/S40networking that points to /etc/init.d/networking. That's the file that should run every time you go to single user mode (which you do on the way up from a cold boot) and that should turn your networking on. Since it seems to be working for me on VMWare Server on Windows XP, perhaps there's a timing issue on Parallels that the networking setup times out before Parallels is ready?

You might also look in /var/log/syslog or /var/log/syslog.[0-9] to see if there are any interesting error messages.

Andrew McKinlay said...

I also have a link in /etc/rcS.d/S40networking that points to /etc/init.d/networking

I looked at the log messages but nothing jumped out. You can see it at:

http://docs.google.com/Doc?id=dg6qtfwt_99gpcpkr

No big deal.

Larry Reid said...

Sorry I took so long to follow up on this thread. Could you post your /etc/init./networking please?

Andrew McKinlay said...

Here it is:

/etc/init.d/networking

Larry Reid said...

Darn. I wanted /etc/networking/interfaces, not the command file. Sorry. What I'm looking for is whether eth0 is configured to come up by default. You'd probably have:

auto eth0
iface eth0 dhcp inet

at the bottom of the file.

Andrew McKinlay said...

Here's what I have:

auto lo
iface lo inet loopback

auto eth0
#iface eth0 inet dhcp

auto eth1
#iface eth1 inet dhcp

auto eth2
#iface eth2 inet dhcp

auto ath0
#iface ath0 inet dhcp

auto wlan0
#iface wlan0 inet dhcp

Should I be un-commenting the iface line(s)?

Larry Reid said...

Yes, I'd try uncommenting the eth0 line anyway. If you have both wireless and wired networks I guess you would do eth1 as well. "man interfaces" describes the file. You might want to look at the "up" clause, which I use to bring up a firewall when the interface is brought up.

I believe this file is specific to the ifup and ifdown commands, which I believe are specific to the Debian family of Linuxes.