Reset the password for a user when Snow Leopard is running as a VM?

Is it possible to reset a user's/root password for a mac image running inside vmware workstation?

I googled for a while and also searched on this site but didn't find anything.

Single user mode (i.e. pressing Cmd+S at boottime) doesn't seem to work under vmware.

Using vmware-fusion tag as the closest possible for this question as I can't create new tags.

----- Adding some notes here:

Finally figured out how to mount the vmdk.

Since my vm is on win7, I shared the vm folder over the network. I used the vmdkmounter (that comes with vmware fusion 3.x ) to mount my vmdk file on a mac. Removed /private/var/db/.AppleSetupDone as mentioned by bmike. I had to use

$ sudo rm .AppleSetupDone

as this file was owned by root.

I followed the instructions here: http://blog.michael.kuron-germany.de/2011/10/mount-ext3-vmdk-in-vmware-fusion/ that shows how to mount the vmdk.

Unmounted the vmdk. Restarted the vm and created a new account.

Before this, I tried a lot of options to mount the .vmdk including - xmount on ubuntu - vmware-mount.pl (comes with vmware server) on ubuntu - winmount application on win7

but none of them really worked for me.

Thanks everyone for your help.


Solution 1:

A quick solution to the problem is to simply make a new admin account with a password you know. The details are covered step by step in another answer, but here is the summary:

You should be able to mount the disk image of the mac using vmware tools and delete the /private/var/db/.AppleSetupDone file. Upon the next boot of the VM, you will be prompted to create a new admin user whereby you can choose a new unique short name (to avoid stomping on an existing account) and use that admin account to reset the other user's password.

If you truly need to enter single user mode from inside your virtual machine, simply remap the keys as described in this KB article from VMWare:

  • Switching Mac OS to Single User Mode