I'm using Microsoft Virtual PC 2007 to run a linux virtual machine, but after some time I can't login to it -- not from the instance on the localmachine or ssh in to the machine. Both give the same response. The login process doesn't finshf, the image shows where it stops:

This only happens when the vm has been running for some days, if I reboot it works fine again for some time before it locks up like this again.
Does anyone have an idea of why this is happening?
Edit: Here are the files.
ls -l /var/pam.d/:
-rw-r--r-- 1 root root 1208 2011-01-20 09:17 common-account
-rw-r--r-- 1 root root 1260 2011-01-20 09:17 common-auth
-rw-r--r-- 1 root root 1509 2011-01-20 09:17 common-password
-rw-r--r-- 1 root root 1201 2011-01-20 09:17 common-session
-rw-r--r-- 1 root root 182 2009-04-17 09:53 atd
-rw-r--r-- 1 root root 384 2009-04-04 07:42 chfn
-rw-r--r-- 1 root root 581 2009-04-04 07:42 chsh
-rw-r--r-- 1 root root 3592 2009-04-04 07:42 login
-rw-r--r-- 1 root root 92 2009-04-04 07:42 passwd
-rw-r--r-- 1 root root 2305 2009-04-04 07:42 su
-rw-r--r-- 1 root root 69 2009-03-27 17:18 samba
-rw-r--r-- 1 root root 520 2009-03-21 10:28 other
-rw-r--r-- 1 root root 168 2009-02-20 18:24 ppp
-rw-r--r-- 1 root root 119 2009-02-17 04:22 sudo
-rw-r--r-- 1 root root 1272 2009-01-28 21:58 sshd
-rw-r--r-- 1 root root 289 2008-11-12 16:47 cron
/etc/pam-.d/login: (comments removed)
auth optional pam_faildelay.so delay=3000000
auth [success=ok ignore=ignore user_unknown=ignore default=die] pam_securetty.so
auth requisite pam_nologin.so
session required pam_selinux.so close
session required pam_env.so readenv=1
session required pam_env.so readenv=1 envfile=/etc/default/locale
@include common-auth
auth optional pam_group.so
session required pam_limits.so
session optional pam_lastlog.so
session optional pam_motd.so
session optional pam_mail.so standard
@include common-account
@include common-session
@include common-password
session required pam_selinux.so open
/etc/pam.d/common-account:
account[success=1 new_authtok_reqd=done default=ignore]pam_unix.so
accountrequisitepam_deny.so
accountrequiredpam_permit.so
/etc/pam.d/common-account: common-auth
auth[success=1 default=ignore]pam_unix.so nullok_secure
authrequisitepam_deny.so
authrequiredpam_permit.so
authoptionalpam_smbpass.so migrate
/etc/pam.d/common-auth session: session
session[default=1]pam_permit.so
sessionrequisitepam_deny.so
sessionrequiredpam_permit.so
sessionrequiredpam_unix.so
sessionoptionalpam_ck_connector.so nox11
auth.log:
(15:36 is problably when I tryed to ssh to the vm, and I got the fault and did a reboot.)
Jun 30 14:17:01 us CRON[1435]: pam_unix(cron:session): session opened for user root by (uid=0)
Jun 30 14:17:01 us CRON[1435]: pam_unix(cron:session): session closed for user root
Jun 30 14:20:01 us CRON[1458]: pam_unix(cron:session): session opened for user root by (uid=0)
Jun 30 14:20:01 us CRON[1458]: pam_unix(cron:session): session closed for user root
Jul 4 15:36:35 us sshd[1945]: Server listening on 0.0.0.0 port 22.
Jul 4 15:36:35 us sshd[1945]: Server listening on :: port 22.
Jul 4 15:36:37 us sshd[1945]: Received signal 15; terminating.
Jul 4 15:36:37 us sshd[2052]: Server listening on 0.0.0.0 port 22.
Jul 4 15:36:37 us sshd[2052]: Server listening on :: port 22.
Jul 4 15:39:01 us CRON[2478]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 4 15:39:01 us CRON[2478]: pam_unix(cron:session): session closed for user root
Jul 4 15:40:02 us CRON[2565]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 4 15:40:08 us CRON[2565]: pam_unix(cron:session): session closed for user root
Jul 4 15:42:29 us login[2451]: pam_unix(login:session): session opened for user glennwiz by LOGIN(uid=0)
Jul 4 15:50:01 us CRON[2677]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 4 15:50:02 us CRON[2677]: pam_unix(cron:session): session closed for user root
Jul 4 16:00:01 us CRON[2754]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 4 16:00:01 us CRON[2756]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 4 16:00:02 us CRON[2756]: pam_unix(cron:session): session closed for user root
Jul 4 16:00:02 us CRON[2754]: pam_unix(cron:session): session closed for user root
Jul 4 16:03:37 us sshd[2799]: Accepted password for glennwiz from 148.140.26.150 port 51330 ssh2
Jul 4 16:03:37 us sshd[2799]: pam_unix(sshd:session): session opened for user glennwiz by (uid=0)
/var/logthat get modified when you log in. Observe if the whole machine crashes or just the login attempt. What happens if you pressCtrl+Alt+F2while at that hung login prompt (nothing, or you go to a different console, and can you log in there)? Separately, to look for potential culprits: tell us the list of files in/etc/pam.d/. – Gilles Jul 4 '11 at 12:04/etc/pam.dstuff is about. Please post the contents of/etc/pam.d/login,/etc/pam.d/common-account,/etc/pam.d/common-authand/etc/pam.d/common-session. Also, look under/var/log(especially/var/log/auth.log, perhaps in the.0file or.1.gzand so on) to see if there are logs from a time when you encountered the problem. – Gilles Jul 4 '11 at 12:44