Showing posts with label mac os x. Show all posts
Showing posts with label mac os x. Show all posts

2008-11-04

VMware Fusion incorrectly assigns user ids for hgfs shares

Because VMware is aimed at CentOS, by default the hgfs shares are set up to be owned by the user with id 501; you'll need to change this so that it's owned by your user. To do this, first run `id`:

$ id
uid=1000(user) gid=1000(user)

Then edit `/etc/fstab` and change the line:

# Beginning of the block added by the VMware software
.host:/ /mnt/hgfs vmhgfs defaults,ttl=5 0 0
# End of the block added by the VMware software

to

# Beginning of the block added by the VMware software
.host:/ /mnt/hgfs vmhgfs defaults,ttl=5,uid=1000,gid=1000 0 0
# End of the block added by the VMware software

Where the values for `uid` and `gid` come from the output of the `id` command as above.

Remount `/mnt/hgfs`:

$ sudo umount /mnt/hgfs
$ sudo mount /mnt/hgfs

Note that you'll have to do this EVERY TIME you upgrade VMware tools.

2008-10-29

Enable Mac OS X Leopard Remote Desktop for VNC via SSH

If you have SSH access to your Mac, you can remotely enable Remote Desktop. However, if you want to VNC into the Mac, you'll need to set a VNC password and turn VNC on. The following huge command turns on Remote Desktop, enables VNC, and sets the password to password.

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -restart -agent -privs -all -setvnclegacy -vnclegacy yes -setvncpw -vncpw password

However, the last part doesn't seem to work, so you can run:

sudo nano /Library/Preferences/com.apple.VNCSettings.txt

and put this as a single line:

6755221DFCC7B786FF1C39567390ADCA

which is the encoding of "password". Now use SSH tunnels, connect, and it should work. You can then change the password via system Preferences to a more secure one.

To turn off Remote Desktop run:

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off

2008-09-04

Apple Remote Desktop and the 3.889 Error

If you have Mac OS X 10.5, you can run "Screen Sharing" which is Apple's version of VNC. However, if you simply enable it and try to connect, you will get an error such as:

VNC server supports protocol version 3.889 (viewer 3.3)
VNC connection failed: Incompatible Version.

This will also appear as similar errors about incompatible security and so forth from various other VNC viewers; the above error is xtightvncviewer on Ubuntu Linux.

The cause of the problem is that Apple's Remote Desktop supports additional features in security that are not part of the normal VNC protocol; to fix it, click "Computer Settings" under Screen Sharing on the Sharing page of System Preferences, and set a password for VNC viewers. Then it will work.

2007-12-25

Connecting a Nintendo DS/Wii to an Airport Express

I was trying to do this, and it was driving me up the wall. I put it in WEP mode, but the DS/Wii wouldn't take the password.

The trick is you need to use the HEX password, which is not what Apple uses by default.



You need to use "Equivalent Network Password" to see the WEP code the DS/Wii will want. Once you have this, it'll connect quite easily.

Of course if you're only using a Wii, you should use WPA2.

2007-12-19

Remotely waking up a Mac

I had forgotten to change a cronjob on my Mac Book Pro at home, but by the time I got to work and sshed back in, it was asleep.

The server was on Gentoo, so I looked at the Gentoo wiki and found that "emerge wakeonlan" would get me the tool to wake up the Mac.

But now I needed the MAC address, and it was asleep! But I remembered dhcp, and looked in /var/lib/dhcp/dhcp.leases and sure enough, there was the MAC address of the Mac.

Running wakeonlan, waiting for it to come alive, and sshing in worked great.

2007-11-18

Simply rsync command

If you want to simply copy the contents of one directory to another using rsync (so you can resume if copying to an SMB mounted filesystem on a wireless link, for example):


rsync -av --size-only /Volumes/Source Directory/ /Volumes/data/Destination Directory


-av tells rsync to archive and be verbose, --size-only tells it only to compare file sizes (as it is a local link, it's faster to just copy the file than to read it up and determine differences). The trailing slash should be on the source directory, but not on the destination directory.