system freezes after successful login

Asked by ankit goel

My problem isn't a login loop (in which the login screen comes again after entering the password) . in my case , The system just freezes when i put my password and press enter. I then have force shutdown my laptop. i dont update anything . it just happened suddenly . also i have been able to login by creating a new user by using command on tty (ctrl+alt+f1) and later i somehow make this new user sudo . for error rectification , i had issue a command for that "not working sudo user" , the command was "mv .Xauthority .Xauthority.bak". this command doesnt help me and it was executed was using tty on the old user . hope it dont further do anything wrong adding to the problem . so i request to pls help me .

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Did you add the new user to the sudo group? This gives it sudo access. You can then rename the file.

Alternatively, drop to root recovery console and run:

mount -o rw,remount /

Then rename the file as normal.

Revision history for this message
ankit goel (ankitgoel2009) said :
#2

hello , thanks for the response
please give some more decription about which file are u talking about . and how would i access it .

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Use this guide until the remount command
https://psychocats.net/ubuntu/resetpassword

You can then rename the file as you said.

Revision history for this message
ankit goel (ankitgoel2009) said :
#4

hi ,
sorry , i didnt even now understand for which file u are talking about . also the link u shared is about reseting passwords but as i stated my password was accepted as without correct password how could i create another user from terminal . please provide some more info about the whole process .

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

I know the link is about password resets (which you don't need). The guide does give how to boot to rrot recovery mode, remount the drive read/write which you DO need to do.

Read between the lines a little.....

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

The file .Xauthority can cause login problems in some cases.
You can delete that file, and if it is needed, it will be automatically be recreated.

Please provide more details for your problem:

Does the system freeze whenever you try logging in with the original user, or only occasionally?
Does the system also freeze when logging in with the new isre?
How exactly does this "freeze" look like? What is on the screen? Do you hear disc activity?

If you still can switch to a virtual terminal in that status (e.g. ctrl-alt-F1), then this is not a total freeze, but only a problem with the desktop environment.

Revision history for this message
ankit goel (ankitgoel2009) said :
#7

ok thanks but one more query do i have to execute all those password reset commands for that user for which login is not working just as shown on the link .

Revision history for this message
ankit goel (ankitgoel2009) said :
#8

ok
query 1 ) Does the system freeze whenever you try logging in with the original user, or only occasionally?
it happened suddenly . before yesterday , it didnt happen anytime in two years for a single time and it is freezing for that user only .
query 2 ) Does the system also freeze when logging in with the new isre?
no , as i stated , i create a new user and it is working fine (atleast as of now) .

query 3 ) How exactly does this "freeze" look like? What is on the screen? Do you hear disc activity?
whenever a freeze occurs , i can move my mouse cursor , can go to virtual terminal (tty using (ctrl-alt-F1) and get back from there using (e.g. ctrl-alt-F7) but nothing happens . i even can login from that terminal entering my username and password and just as i said i even create a user .

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#9

You just follow it until the remount command, then you can rename the Xauthority file as you initially stated

Revision history for this message
ankit goel (ankitgoel2009) said :
#10

do i have to use same command which i executed
mv .Xauthority .Xauthority.bak

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#11

You'll need to run:

cd /home/actionparsnip

First, obviously change "actionparsnip" for your actual user name in Ubuntu that you are logging in as.

Revision history for this message
ankit goel (ankitgoel2009) said :
#12

unable to go to recovery mode .
i tried by pressing down shift from the very beginning , i also tried to press key multiple times that i failed to get the recovery mode . i also tried by pressing escape instead of shift and from there i press F11 - System Recovery but again that dont give me option to select recovery mode

Revision history for this message
Manfred Hampl (m-hampl) said :
#13

For the grub recovery mode:

Boot normally, log in and issue the command

sudo gedit /etc/default/grub

I assume that the lines 6 to 9 look similar to this:
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10

edit these lines and change them into

GRUB_DEFAULT=0
# GRUB_HIDDEN_TIMEOUT=0
# GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=5
GRUB_TIMEOUT_STYLE=menu

(one line added)

Then save the file and close the editor and issue the command

sudo update-grub

Finally reboot.

Revision history for this message
ankit goel (ankitgoel2009) said :
#14

this is the output of
command 1) sudo gedit /etc/default/grub

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

Revision history for this message
Manfred Hampl (m-hampl) said :
#15

Yes, that is what I wrote.

Put a hash sign ('#') in front of lines 7 and 8.
Change the value 10 into 5 in line 9
Insert an additional line with contents "GRUB_TIMEOUT_STYLE=menu" after line 9.

Save the file, close the editor, issue the command "sudo update-grub" and reboot.

Revision history for this message
ankit goel (ankitgoel2009) said :
#16

hi manfred ,
as suggested by you i successfully reached recovery console and issue the " mount -o rw,remount " command . but after that the system freezes and i cant do anything .at there i noticed that when i tried to write somethings , it writes on the screen itself just like when we have Low RAM . i dont know what i press , i some how managed to get out of there but again reached a terminal like screen which says "display all 2512 possibiities(y or n ) " . i type n , nothing happens, then type y , then press escape , then tab , then reoot , then exit , but it doesnt type anything on the screen . the cursor keeps blinking . i was scared so i press power button and restarts . pls guide me .

Revision history for this message
Manfred Hampl (m-hampl) said :
#17

I suggest that you perfom a memtest (from the grub menu) to verify whethere your hardware is healthy.

Revision history for this message
ankit goel (ankitgoel2009) said :
#18

hi manfred ,

actually i am afraid now to perform a memtest using grub due to my previous experience , as i have heard that playing with grub has been a nightmare for many people and can cause serious boot issues including formatting the o/s in the end too . can u suggest me some another option to recover that user without using grub as i cant take the risk of losing my entire o/s just for one user . after all , i can access the data fortunately . i am a c# programmer and i have large amount of data (around 500 gb ) which i can not afford to lose even mistakenly . Can u guide me how to use or bring the operating system installed on virtual box of my previous user account . i will be highly thankful to u .

Revision history for this message
Manfred Hampl (m-hampl) said :
#19

1. If you are afraid of eventually losing data, then there is only one advice that can be given: backup, backup, backup.

2. I do not understand your remark about grub, boot issues and formatting the o/s.
I do not see any possibility how grub should cause data loss.

3. There is no need to "playing around with grub" for performing the memtest.
Just boot the system and select "memory test" from the grub menu.

4. If you already have a new user with sudo authorizations, then this user is able to access all data from the old user.

Revision history for this message
ankit goel (ankitgoel2009) said :
#20

hi manfred ,
i understand all of your points from 1 to 3 but regarding point 4 , i have an problem that although i can access the data , i am not able to retrieve my virtual o/s installed on virtual box . that is a big concern for me as a programmer as i have some important code inside that virtual o/s which i am not able to retrieve . so any help of how to get that will be highly highly appreciateable by me after all its a matter of my job . thanks

Revision history for this message
Manfred Hampl (m-hampl) said :
#21

Please explain the role of virtualbox in your problem.
Is the VM located in the home directory of the old user?

Revision history for this message
ankit goel (ankitgoel2009) said :
#22

hi manfred ,
yes the vm is located in the home directory of the old user . below are the other information which can be important
1) i cannot copy the .vdi image from there(old user directory) using "right click amd copy " . it is denying me .
2) i start current user virtualbox . i dont see any option to use that old user . infact i tried import appliance but its of no use .
3) i think although i am also a sudo user too just like the previous one , but my permissions to modify files on old users directory are not equal to my current user . may be this is the beauty of linux ( you can use me but not modify me or delete me ) .

so i think if somehow i become able to copy that .vdi file from that old user , may be the things can become "work in progress" . but yes , it is just an imagination . this could be a silly thing to thought of .

Revision history for this message
Manfred Hampl (m-hampl) said :
#23

The pitfall is that when running the file explorer program you do not have admin rights, but only rights of a normal user.

There are two possibilities to circumvent that:

Open a terminal window and use sudo
or
start the file explorer with sudo (i.e. "sudo nautilus"). You have to be extremely careful with that, because a wrong click or drag in that mode has the potential of making the whole system unusable.

But back to the discussion around .Xauthority:
When logged in with your new user, you should be able to delete (or rename) the .Xauthority file of the old user.
You should try "sudo rm -v /home/oldusername/.Xauthority".
Maybe you can then log in again with the old user, making all other work unnecessary.

Revision history for this message
ankit goel (ankitgoel2009) said :
#24

Hi Manfred , I tried the command as u say and the system replied that it removed the file . After that I restart and tried to log in with old user but no success . But something strange happened , I press control+alt+f1 as I thought it's better to shut down by command rather than manual pressing power button .
But instead of tty terminal I found some weird messages coming and repeating themselves
Here are few lines
Print_req_error : I/o error , dev sda
ata1.00 : status :EDRDY ERR3
ata1.00: error :EUNC3
ata1.00:irq_stat 0x400000008
ata1.00:failed command :read FPDMA Quoted
These messages on black terminal repeats themselves , after sometime the system reboot itself . Then I again tried to login with old user but this time even the ctrl+alt+f1 don't lead me to tty terminal or either to that weird messages coming and coming . I found on internet that they are not good for system . Pls guide me

Revision history for this message
Manfred Hampl (m-hampl) said :
#25

These messages indicate a problem on the hard disk, or the disk controller.
I suggest that you shut down the system and let it cool down.

I hope that you do have backups.

Revision history for this message
ankit goel (ankitgoel2009) said :
#26

ok i am shutting down , but what should i do tommarrow in addition of start creating backups .

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#27

Sounds like a plan

Revision history for this message
ankit goel (ankitgoel2009) said :
#28

No sir ,
This is not a plan . I still need suggestions

Revision history for this message
ankit goel (ankitgoel2009) said :
#29

I have not tried Ubuntu without installing or had ever tried to boot Ubuntu from usb . But I have something to tell . I have a working kali Linux usb stick with persistence fully working ok . From there , I can access the home directory or any directory or anything even root files of my old user , new user without any problem .I can move or delete whatever I want using kali stick . Does that help

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#30

Yeah use that to rename the file you said...

Revision history for this message
ankit goel (ankitgoel2009) said :
#31

as i said i had even delete it but it doesnt solve my problem .

Revision history for this message
Manfred Hampl (m-hampl) said :
#32

If you copy the files from the old user into the home directory of the new user and set the ownership accordingly, what happens? Can you log in with the new user and access the file as desired?

Revision history for this message
ankit goel (ankitgoel2009) said :
#33

if u are taking about copying files from old to new user with the help of kali linux , then there is no problem in copying , moving , deleting or even accessing
if u are talking about copying files from old to new user within the same ubuntu o/s , then there are some problems regarding , moving or deleting but if i got successed in copying files from old user to new user home or desktop , then i can access that (not delete ) the files but still no problems what so ever in my new user .
but in the above both cases , i had not tried to change or set the ownership as i dont know how to change permissions .

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#34

Could find out how to change permissions... Using the Web. Nobody is born knowing. Why not find out and come back with questions or clarification.

Revision history for this message
ankit goel (ankitgoel2009) said :
#35

can you please elaborate mr. actionparsnip (andrew-woodhead666) , has anyone recommend me to change permissions till yet . so why should it change it before consulting anyone. and as per your comment " Nobody is born knowing " i suggest dont do anything without proper knowledge as "half knowledge is more dangerous than nothing" . so i suggest , Before posting please do read a little between the lines mr. actionparsnip (andrew-woodhead666)

Revision history for this message
Manfred Hampl (m-hampl) said :
#36

Just to clarify the current status:

Is the following correct:
When logging in with the old user, the system freezes.
When logging in with the new user, there is no such freeze problem.

You have already copied files from the old users's home directory to the new user's home directory, and when logged in as the new user these files can be successfully accessed.

Starting virtualbox with the new user does not show any VM.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#37

If you move data to a new system it may not be owned by your user and may be owned by roo so you won't have access to the data even though its in your user's home directory.

Revision history for this message
ankit goel (ankitgoel2009) said :
#38

Hi manfred
query 1) When logging in with the old user, the system freezes.
answer : yes , all the time , everytime .

query 2) When logging in with the new user, there is no such freeze problem.
answer: yes no problem what so ever . working good .

query 3 ) You have already copied files from the old users's home directory to the new user's home directory, and when logged in as the new user these files can be successfully accessed.
answer: i had copied (not moved as it dont allowed me ) some files but not all files from old users directory . those files are working correctly in new user desktop. also it dont let me open some files[on the old users directory] stating that i dont have permissions like some pdf files or some folders , so for those files which i cant open , i cant even copy those files to my new user directory .

query 4 ) Starting virtualbox with the new user does not show any VM.
yes it is not showing any previously installed vm image (by the old user) . It starts as if i have newly installed virtual box software with no VM images whatsoever . i had earlier tried to even copy vm image from old user to new user although it dont allowed me to copy ( with the help of kali linux stick) but still after copying , it is not allowing me to open that image saying me that some "kernal driver is not installed ".

Revision history for this message
Manfred Hampl (m-hampl) said :
#39

For copying the remaining files from the old user to the new user:

Log in with the new user (or use a live system)
Open a terminal window
issue a copy command with sudo, e.g. something like
sudo cp --verbose --interactive --recursive /home/olduser /home/newuser

Another possibility for accessing files in the old user's directory is removing the access restrictions with a command like
sudo chmod w+rw /full/path/to/the/file

Revision history for this message
ankit goel (ankitgoel2009) said :
#40

Hi Manfred ,
Actually the problem is not copying anymore . I had backed up the hard disk . The problem is
 I want to open that virtual box image in virtual box as I had installed an O/s Inside it and inside that o/s I had some softwares which are very costly to me. so even with copying or changing permission I can't use the vm image . Virtual box is denying me to open it . So even if I change permission for that vm image file, does that help me

Revision history for this message
ankit goel (ankitgoel2009) said :
#41

Also I want to know and correct the root cause which had banned my old user to login .

Revision history for this message
Manfred Hampl (m-hampl) said :
#42

For the root cause of the failure with the old user I have not see anything that would explain that. Sorry, but I have no idea.

A virtualbox VM consists of (at least) two files. A virtual disk (probably *.vdi) and a config file (*.vbox, a text file that can be edited if required).

Where are these files corrently located? In the old user's diretcly or the new user's directory or somewhere else?
What are the file access settings of these files and the directory that contains these files? Does the new user have write access to them?

What happens if you make a doubleclick on the *.vbox file?

Revision history for this message
Launchpad Janitor (janitor) said :
#43

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.