Archive for the ‘Mac OS X’ Category
VMWare Fusion NAT
This is to correct an earlier omission and provide instructions for configuring static and dynamic IP addresses for Virtual Machines runing on VMWare Fusion on Mac OS X. The benefit of static IP address is important for those installing multiple development and test instances of Oracle Databases in virtual environments.
Back in September 2008, I blogged about how to configure the Oracle Client 10g on Mac OS X. It’s been used a lot but in hindsight it could have been organized more effectively. One thing that I noticed (through somebody bringing it to my attention) is that explaining the VMWare Fusion component by itself would have been more helpful then listing the IP ranges for releases through the date of my post. Hopefully, this corrects that omission.
VMWare NAT Configuration
There are only a few steps that you must do. These are they:
- Read the subnet value from the
dhcpd.conf
file. - Dynamic IP address only require you to set the guest operating system to DHCP.
- Static IP addresses require you to set the IP address, subnet, default gateway, and preferred DNS server.
- Add assigned IP address and the guest operating system
hostname
to your Mac OS X/etc/hosts
file.
The next sections gives the details of where to find all the things that you may want to experiment with. Remember if you make an error that damages these configuration files, you have to fix it or re-install VMWare Fusion.
VMWare NAT Files and Configurations
You can find the IP ranges for the Network Address Translation (NAT) here in VMWare 3:
/Library/Application Support/VMware Fusion/vmnet8/dhcpd.conf |
VMWare 4 changes the location, qualified below.
You can find the IP ranges for the Network Address Translation (NAT) here in VMWare 3:
/Library/Preferences/VMware Fusion/vmnet8/dhcpd.conf |
You can open the file for editing like this:
sudo vi "/Library/Application\ Support/VMware\ Fusion/vmnet8/dhcpd.conf" |
The file contains the subnet, which I’ve found changes with release. You can configure this file and assign fixed addresses in it. However, you don’t need to install fixed addresses in this file unless you want to reserve addresses in the dynamic range.
The dynamic range is between xxx.xxx.xxx.128
and xxx.xxx.xxx.254
. The range of xxx.xxx.xxx.3
to xxx.xxx.xxx.127
is available for static IP addresses. You can set a static IP address inside the native operating system of the VM.
The dhcpd.conf
file with it’s instructions, looks like this:
# Configuration file for ISC 2.0 vmnet-dhcpd operating on vmnet8. # # This file was automatically generated by the VMware configuration program. # See Instructions below if you want to modify it. # # We set domain-name-servers to make some DHCP clients happy # (dhclient as configured in SuSE, TurboLinux, etc.). # We also supply a domain name to make pump (Red Hat 6.x) happy. # ###### VMNET DHCP Configuration. Start of "DO NOT MODIFY SECTION" ##### # Modification Instructions: This section of the configuration file contains # information generated by the configuration program. Do not modify this # section. # You are free to modify everything else. Also, this section must start # on a new line # This file will get backed up with a different name in the same directory # if this section is edited and you try to configure DHCP again. # Written at: 02/18/2010 23:30:54 allow unknown-clients; default-lease-time 1800; # default is 30 minutes max-lease-time 7200; # default is 2 hours subnet 172.16.123.0 netmask 255.255.255.0 { range 172.16.123.128 172.16.123.254; option broadcast-address 172.16.123.255; option domain-name-servers 172.16.123.2; option domain-name localdomain; default-lease-time 1800; # default is 30 minutes max-lease-time 7200; # default is 2 hours option routers 172.16.123.2; } host vmnet8 { hardware ethernet 00:50:56:C0:00:08; fixed-address 172.16.123.1; option domain-name-servers 0.0.0.0; option domain-name ""; option routers 0.0.0.0; } ####### VMNET DHCP Configuration. End of "DO NOT MODIFY SECTION" ####### |
Unless you’ve changed the location of your VM repository on your Mac OS X, you can set a fixed-address for the virtual machine. You add the following lines at the bottom of the dhcpd.conf
file:
host mclaughlinxp32 { hardware ethernet 00:0c:29:55:38:1b; fixed-address 172.16.123.21; } |
You pick whichever IP address you’d like to use. You also need to configure the guest opearting system in the VM with that same IP address. You can find the ethernet hardware value in the following file:
~/Documents/Virtual Machines/VMName/VMName.vmx |
You can open the file and hunt for it, or simply run this command from the directory where the file exists:
grep ethernet0.generatedAddress *.vmx |
As always, I hope this helps some folks.
Mac OS X Limits for Oracle
A couple months ago, I tried to install Oracle Database 10g, Release 2 for Mac OS X on Intel x86-64 on a MacBook running generic Snow Leopard. It didn’t work because you must have the Mac OS X Server. Somebody asked me to post more of what I found when I tried to hack the installation. Oracle’s documentation Oracle™ Database Installation Guide 10g Release 2 (10.2) for Apple Mac OS X (Intel), B25286-01 clearly states that the installation requires Mac OS X Server edition. By the way, this is one of the best installation guides I’ve seen from Oracle because it is very complete.
You can determine which version of Mac OS X you’re running with the following:
# sw_vers |
It won’t work when you’re on a generic Snow Leopard release, like this:
ProductName: Mac OS X ProductVersion: 10.6.2 BuildVersion: 10C540 |
The first place you’ll get stopped cold is during the installation. You can specify the kern.sysv.shmmni
value in the sysctl.conf
file at the required 4096
but it won’t allow reconfiguration from the default value of 32
. The inability to override this value stops the Oracle installer. You can see the default value of the shared memory parameters by running this command in a terminal session:
# /usr/sbin/sysctl -a | grep \\.shm |
You should see the following:
kern.sysv.shmmax: 4194304 kern.sysv.shmmin: 1 kern.sysv.shmmni: 32 kern.sysv.shmseg: 8 kern.sysv.shmall: 1024 |
I haven’t tested it on the Mac OS X Server edition yet. I’ve a hunch that it’ll work like a charm. When I do get to that, I’ll update the post. Here’s the Apple support note on kern.sysv.shmmni
for the Server version.
What a VMWare Thrill …
I’d upgraded from VMWare Fusion 2 to 3 and taken care of most instances. A NASTY surprise awaited me when I tried to upgrade my Linux installations this morning.
You MUST to uninstall VMWare tools from your repository of Linux operating systems before upgrading your VMWare Fusion or ESX server. If you don’t, you can’t access the console because the drivers make the console look like this:
Perhaps I missed this note when, as an early adopted I opted to move straight to VMWare Fusion 3. I would have complied with these instructions to avoid this headache.
All that’s required now, is that: (a) I export 500 GBs worth of virtual machines to another machine running VMWare Fusion 2; (b) Individually start each machine and run the uninstall VMWare Tools command individually; and, (c) Shutdown and reposition all virtual machines on the original server.
As stated in the note, the command to remove it is:
/usr/bin/vmware-tools-uninstall.pl |
Click on the note in the event the link fails to resolve, which would mean the note vanishes into oblivion some day in the future …
While I’ve another machine that’s not yet upgraded, this is a major inconvenience. It’s a shame that the Linux components don’t install automatically. It’s a shame that the install didn’t say something like, “Don’t do this if you’ve Linux virtual machines, unless you’ve removed their VMWare Tools installation.”
Another word to the wise, you don’t get the Linux Tools automatically when you download the product. The software prompts you to download the additional components when you attempt to launch a Linux environment. A cruel irony since by the time you see the prompt, you can’t! This is a change from the prior upgrade process.
Yes, haste makes waste but now I know. In the future, treat all VMWare upgrades like those from Microsoft test, re-test, re-authenticate in a small way before upgrading. Do you think VMWare really want to send that message to its customer base?
I got back to this tonight, and thanks to Red Hat’s Session Manager I was able to fix the Red Hat VMs. Launching it, I simply switched to the Failsafe Terminal and ran the following command, as per the note:
# /usr/bin/vmware-uninstall.pl |
After that, I rebooted. Then, installed (mounted the VMWare Tools disk) from the VMWare Fusion menu. Opening a terminal as root
, I then re-installed and configured VMWare Fusion. Those are done. As more time allows, I’ll update about the others.
I’m now reconfiguring the network since the VMWare Fusion 2 bridged at a 172.16.153 subdomain and VMWare Fusion 3 bridges at a 172.16.123 subdomain.
iPad Thoughts …
This is probably defensive because I’ve had to answer the question about two dozen times since the iPad product announcement. The question is naturally, what do yo think about the iPad?
My perspective is biased by the fact that I’ve been using both DOS/Windows PCs and Macs since the 1980s. They each have merits but in short, unlike the media, I have a bias toward Apple products. In fact, I’m an old NeXT system administrator (software gone from the scene because as rumors have it, Steve wouldn’t think of letting the company become ONLY a software company).
I think the idea of the iPad for eBooks is awesome, the features are terrific. It clearly is a better opportunity for my digital movies but a bit awkward because of its size.
I can’t travel with an iPad by itself because it doesn’t support Microsoft Excel, Word, or Visio. That means I’d have to have my MacBook Pro and iPad. Ouch, the security folks will go nuts at the airport, and my bags are now heavier by about 2 pounds. The iPad is 1.5 pounds but the charger has weight too.
I understand all the logic for the device but there’s an underlying assumption in placing everything on the web. Some data can’t be on the web because of legal limits. This goes to my sticking point. Apple’s Office Suite isn’t as robust as Microsoft’s Office Suite. Keynote is easier to use and easily preferred over PowerPoint, but Numbers isn’t even close to Excel (here Apple fails). The problem with Pages is that many companies have templates built around Word and there’s no easy migration back and forth.
Perhaps Apple will reach out to Power Excel users and invest in Numbers to bring it into this millennium; and maybe they’ll also fix the portability between Word and Pages too. For example, one company I work with insists that I use Word 2003 because they’ve never updated their templates to Word 2007 (easy to do through VMWare Fusion). Then, all that’s needed is a rock solid replacement for Visio on Mac OS X.
I think that I might buy one to experiment with, just so I’m current with the product and new features. I’ve also got some product ideas that I’d like to explore but I don’t think this is a home-run like the iPod and iPhone without vitualization software to enable Windows. As an afterthought, maybe the announcement this summer will be “you can have it all now” when they port most features to the core OS X operating system. That would induce me to upgrade my MacBook Pro, wouldn’t it get you to do so too?
CrossOver Plus Limits
While reconfiguring my iMac, it was interesting to note the bumpy road to implementing Code Weaver’s CrossOver Plus 8.0.1 for the whole Microsoft Office Suite. Previously, it had only been used to support Microsoft Visio 2007.
I discovered that a Shutdown and Start operation was required after installing CrossOver Plus because a Restart hadn’t worked. Attempting to create the WINE bottle with a reboot gave me the following error:
The Microsoft Office 2007 package requires CrossOver HTML engine to install and run properly. Continuing with the install may produce unpredictable results. |
I also found that patching the Office product failed. It’s possible that could be the network here, but there’s also no manual way to download *.msi files and apply them against the WINE bottle. It’s possible that a trick was missed and there is a way to do it. Downloading and right clicking on the *.msi file on the Mac OS X side allows you to look for an application to help but I couldn’t find a helper application in the CrossOver Plus folder tree. It may be there, however, where it is eluded me in the time my patience would allow (please comment if you know its location)?
Rather than use Google Quick Search Box I thought symbolic links would be helpful in the Applications folder since I actually also run Microsoft Office 2008. Turning to Chapter 6 in the product documentation didn’t solve the problem. It led me to an incorrect folder location.
They’re not here, as stated in the product documentation:
You can find them in the WINE bottle folders here, the default is for Windows XP:
Within the Bottle folder, you can find the Microsoft Office 2007 links here:
The CrossOver Plus installation suppresses the options dialog to choose a typical, full, or custom installation of Microsoft Office 2007. That means you get typical, which means you can’t connect to a remote database using the JDBC et cetera. This doesn’t meet my needs and means I’ll have to put another VMWare instance together to work with Microsoft Excel 2007 reasonably. Drat!
VMWare nabs me again …
When I run into failures on VMWare Fusion, they’re always a bit tedious. This one happened on my iMac (OS X Leopard) running VMWare 2 (both constrained to old releases by university governance policies). The VM is Microsoft Vista in an IDE partition, it hung after running too long. I had to force quit the application. On reboot the socket file was still there, and it gave the following error message when trying to start it.
Here’s the error in plain text, so search engines can find it for others.
Virtual device serial0: File "/var/folders/Sf/SfvoJITAHMq1Vp8bNI7QZU+++TM/-Tmp-//vmware-mmclaugh/thnuclnt-641/socket" exists, but no server is listening to it. There are three possible causes for this: - The server is alive but not ready yet, and you can retry later. - The server is busy communicating with another client, so you cannot run this client at the same time. - A previous server exited abruptly, and you can remove the file and try again. The device will be disconnected. |
How to fix it?
Delete the file, right? Yes, but there’s a trick. Navigating through the -Tmp-
directory required a Unix shell trick because the -
(dash) is a switch and backquoting it with a \
(backslash) didn’t work. Jeff Yoder, told me the trick to change directory into a dash leading directory name. It was this:
cd -- -Tmp- |
The --
is how most shells mark the end of options to a command. After a --
all -
(dashes) are treated as ordinary characters.
Mark Olaveson reminded me that using the present working directory before the directory name also worked. It demotes the dash to an ordinary character too.
cd ./-Tmp- |
When I got to the directory, there was the socket file. I deleted it and everything worked like a charm.
srwxrwxrwx 1 mmclaugh staff 0 Dec 8 13:04 socket |
Black Screen of Death
Holiday Gift from Microsoft
Windows 7 ships. Then, we find it’s really Windows Vista+ (code base 6.1). Now, Microsoft give us a late year present, the Microsoft Black Screen of Death (their original post has been wiped by agreement with Microsoft it appears but only the shadow knows and rumors on the web). What better excuse to rush out and buy a MacBook Pro or use this fix?
Holiday Gift from Apple
Buying a MacBook Pro makes sense if you don’t already have one. Owning one, I’m hesitant to upgrade my MacBook Pro because the battery in the new one requires a service call when the battery wears out. An expensive item because the battery life is generally poor after 1,000 recharge cycles and that number of recharges may or may not occur before your Applecare service contract runs out.
Battery life/replacement is one of the reasons why I’ve stayed on my old MacBook Pro (purchased 16 months ago). The other reason is that I plan on getting by with a MacBook Pro for 4 to 5 years not Apple’s apparent plannned obsolescence of 3 years. While I’m in the gripe mode, the new Apple Cinema Display is attractive but not compatible with older MacBook Pro or MacBook computers. Also, the Altona DVI to Mini Display Port has mixed reviews out there and Apple seems disinterested in helping owners of older machines use the new Cinema screens. There aren’t any other alternatives to the Altona product (at least that I’ve found). I almost feel that somebody at Apple watched the movie Robots too often because it seems my 16 month old MacBook Pro is an outmode and there isn’t an upgrade option (only a new purchase).
Reset your MySQL Password
A couple students stumbled on the MySQL on-line documentation today. Specifically, they didn’t find instructions on how a non-root
user could change their password. I’ve also added this as an explanation on the MySQL documentation for 12.5.1.6. SET PASSWORD
Syntax page.
You reset your own password when you’re not the root
user with this syntax:
mysql> SET PASSWORD = PASSWORD('new_password'); |
This is simple syntax but carries a risk if you walk away from your terminal because somebody can run it without needing to know the original user password. Oracle requires that you know the original password if you use this syntax:
SQL> PASSWORD Changing password FOR PLSQL OLD password: NEW password: Retype NEW password: Password changed |
If you think that you’re safe walking away from an Oracle SQL*Plus console, check this because it doesn’t require knowing the current password either.
SQL> SHOW USER USER IS "PLSQL" SQL> ALTER USER plsql IDENTIFIED BY plsql; USER altered. |
Don’t walk away, always lock your terminal or use the QUIT
command to exit MySQL. This generally prevents somebody hijacking your password. You can check this post if you’re interested in changing the root
password when you don’t have it to begin with. Hope this helps a few folks.
Convert DVD to ISO on Mac
Another faculty member asked me how to convert a DVD to an ISO on his Mac. Here are the instructions for everybody.
He needed to convert it because he wanted to deploy it on a Netbook from a USB drive. We all know you shouldn’t do this unless you’ve paid for the license and are only installing it on a single machine, like the Adobe license specifies.
The only tricky part to this is the last command-line step, which I borrowed from Mac OS X hints.
1. Open Disk Utility on your Mac OS X. It’ll look something like this:
2. Click the New Image icon in the tool bar, and save it as a compressed file. This writes it as a .dmg
file, which is an Apple format .iso
file.
It’ll take a while to write. The length of time is relevant to the size of the image on the DVD.
3. This is the first of two tricky steps. They’re tricky because you need to use the command-line. If you followed the instructions, you’ve saved the .dmg
file on the Desktop. Now, you need to convert the .dmg
formatted file to an .iso
formatted file. You open Terminal, which is found in your Applications folder. Once launched follow the steps below. Change the directory to the Desktop
or the folder where you put the file. You must do this before running this command because I’ve used relative file syntax (more or less only the file name). Alternatively, you could provide fully qualified file names.
MacPro:~ mclaughlinm$ cd Desktop MacPro:Desktop mclaughlinm$ ls *.dmg Acrobat9.dmg MacPro:Desktop mclaughlinm$ hdiutil convert Acrobat9.dmg -format UDTO -o Acrobat9.iso Reading Acrobat9 (Apple_ISO : 0)… ............................................................................................................... Elapsed Time: 27.655s Speed: 22.2Mbytes/sec Savings: 0.0% created: /Users/mclaughlinm/Desktop/Acrobat9.iso.cdr |
4. Before you copy it to your Windows USB, you need to remove the trailing .cdr
from the file name. The syntax at the command-line is:
MacPro:Desktop mclaughlin$ mv Acrobat9.iso.cdr Acrobat9.iso |
5. Open Finder, and copy the .iso
to your USB drive, and delete the temporary copy.
Hope this helps some folks.