After a few months of booting into 32 bit mode, that got tiresome too. Shutting everything down, rebooting and then doing the work I needed before rebooting to go back to 64 bit again. Yawn. So two updates for you.
Faster switching
The first is that there is an easier way to switch between 32 and 64 bit mode without sitting holding keys down. You'll need to create a file called 32bit.sh in your home folder containing the two lines:
systemsetup -setkernelbootarchitecture i386
reboot
This simply tells your mac to set the boot architecture to 32 bit and then starts the reboot. To use this make it executable by typing
chmod +x 32bit.sh
in a terminal window when you're in your home directory. You'll want to add a corresponding 64bit.sh file too
systemsetup -setkernelbootarchitecture x86_64
reboot
and, again, make it executable.
To go to 32 bit mode, make sure you've saved everything you have open and then at the terminal type
./32bit.sh
If all has gone to plan you'll see it flash the commands on the screen and then your machine will reboot in 32 bit mode so you can start your VPN. Once you're done reverse the operation by running the 64bit.sh script.
No switches necessary
This one is a little more complicated but if you're looking for info about VPN fixes/workarounds I'm certain you'll keep up. You'll need the
VPN remote desktop workaround I mentioned in the last post about VPNs. Once you have that working and have tested using the VPN while logged in remotely on RDC come back here for the next steps.
Okay, still with me. Next you'll need to install Cygwin on the Windows box and include the openSSH option from the list of packages. Lifehacker has a great setup guide for that.
Once you've got thru that install, test logging into the machine from your mac terminal window. You'll need the local IP address of the box running cygwin and your username. If your username has a space in it, at the command line you'll need to add a backslash before the space as an escape character e.g.
ssh My\ Username@192.168.1.110
If that works you're almost there.
The final step in connecting your mac to the VPN is to find out which ports on the VPN machines you're trying to hit. In my case, the client has MySQL and SQL Server databases so that's 3306 and 1433 respectively. To connect to SQL Server I created another shell script in my home directory on the mac called clientNameSQLServer.sh and made it executable. The contents
ssh -L 1433:xxx.xxx.xxx.xxx:1433 My\ Username@192.168.1.110
obviously replacing xxx.xxx.xxx.xxx with the IP Address for the remote VPN SQL Server, replacing "My\ Username" with your username and the local IP address with your own IP for the machine with Cygwin. This script forwards any requests on localhost:1433 to the remote VPN IP address you provided.
To fire it all up you'll remote desktop to the windows box. Start the VPN and reconnect to the remote desktop if it boots you. If you don't get back to the desktop, something wasn't right. As long as you see the remote desktop launch cygwin to make sure it's up and running. On your mac, go to the command line in terminal and execute the shell script
clientNameSQLServer.sh
. Now you can use your local Mac SQL Server client of choice, or even Microsoft Excel / Query to connect to the server. The only change to the way you would expect is that instead of setting the servername of the SQL server in your tool to the actual remote IP you use localhost:1433.
You're welcome.