Mouse and Keyboard stopped working on Ubuntu 16.04 guest

Discussions about using Linux guests in VirtualBox.
Post Reply
FrugoFruit
Posts: 7
Joined: 19. Apr 2017, 13:37

Mouse and Keyboard stopped working on Ubuntu 16.04 guest

Post by FrugoFruit »

Hello everybody :)

Problem description:
Today I re-launched a saved state and noticed that suddenly I was in a windowed mode.
I turned the system off and on again, and, to my surprise, the mouse and keyboard stopped responding in the guest (except things like ctrl key or ctrl+alt+del, which basically bring up host so it's not helpful).

The keyboard works before the system is booted - I am e.g. able to bring up Grub and run the recovery mode.
In the recovery mode, I can access the shell and type commands, but if I try to run failsafe graphics mode then it loads up but again without any ability to use the keyboard or mouse in the guest.

System:
I use virtualbox 5.1.18 and have an Ubuntu 16.04 host. I've been using this host for a week.

Attempted fixes (ideas found on the internet)
1. Multiple reboots of both host and guest
2. Ejecting and reintroducing mouse/keyboard cable - no change
3. I tried inserting guest additions - got the following message:
"Unable to insert the virtual optical disk C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso into the machine ubuntu-ml.
Could not mount the media/drive 'C:\Program Files\Oracle\VirtualBox/VBoxGuestAdditions.iso' (VERR_PDM_MEDIA_LOCKED).
Result Code: E_FAIL (0x80004005)
Component: ConsoleWrap
Interface: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}
Callee: IMachine {b2547866-a0a1-4391-8b86-6952d82efaa0}"

Then I read that in such case, I should mount the guest additions iso first, but then I get virtually the same error. I do get a different action though: force unmount. When I choose it, again nothing happens.

Can somebody save me please? Reainstalling and reconfiguring ubuntu, creating secured local repositories with ssh key, creating virtual environments, all this would take me a lot of time, and what if the problem reappears? :cry:

EDIT: added the log files and output of the "VBoxManage showvminfo ubuntu-ml --details" command as requested by the user Perryg. Note that I didn't know which log file should I upload, so I zipped the whole folder.
EDIT2: for whatever reason the text files inside of the folder disappeared and are not inside the zip file - I attached them separately
EDIT3: the forum does not permit me to have more than 3 attachmets, so the last one is uploaded to my post below
Attachments
VBox.log
(97.69 KiB) Downloaded 133 times
command_output.txt
(4.35 KiB) Downloaded 121 times
Logs.7z
(33.77 KiB) Downloaded 111 times
Last edited by FrugoFruit on 19. Apr 2017, 15:40, edited 3 times in total.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Mouse and Keyboard stopped working on Ubuntu 16.04 guest

Post by Perryg »

Post the guests log file ( as an attachment ). Right click on the guest in the Main Manager then click show log. Save and post as an attachment. Compress if it is too large to post.

and

From the hosts terminal/command window type VBoxManage showvminfo <VM Name> --details and post here. Replace <VM Name> with the actual name of the VM. Use " " if the name has a space in it.

Note if the host is Windows you need to be in the directory that has VBoxManage.exe for the command to work.
FrugoFruit
Posts: 7
Joined: 19. Apr 2017, 13:37

Re: Mouse and Keyboard stopped working on Ubuntu 16.04 guest

Post by FrugoFruit »

Dear Perryg,

thank you for the quick answer!

I uploaded the files as requested.

Kind regards,
Jan
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Mouse and Keyboard stopped working on Ubuntu 16.04 guest

Post by Perryg »

The logs really don't show a problem except you are maxing out the host cores and RAM. Lower the cpu count to one and the RAM to 4GB.

The reason you can not mount the new guest additions is because they are already mounted and you just need to install them from the guest terminal, but if it will not boot properly little can be done in that regards.

When you see the guest and the mouse and keyboard are not working can you press the host+F1 and get a tty? If so can you log in there? If so then we can proceed with installing the proper guest additions.
FrugoFruit
Posts: 7
Joined: 19. Apr 2017, 13:37

Re: Mouse and Keyboard stopped working on Ubuntu 16.04 guest

Post by FrugoFruit »

Unfortunately, nothing happens when I press host + F1, although e.g. host + r (which resets the vm) does work...
Is there anything else I can do to try to salvage this?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Mouse and Keyboard stopped working on Ubuntu 16.04 guest

Post by mpack »

Have you tried disabling USB support in the VM settings?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Mouse and Keyboard stopped working on Ubuntu 16.04 guest

Post by Perryg »

Try with what Don said and if that does not work create a new test guest and boot the live CD Ubuntu 16.04 and see if the mouse and keyboard still work. Do not change any of the default setting for this test.
FrugoFruit
Posts: 7
Joined: 19. Apr 2017, 13:37

Re: Mouse and Keyboard stopped working on Ubuntu 16.04 guest

Post by FrugoFruit »

mpack wrote:Have you tried disabling USB support in the VM settings?
What do you mean by that?
I see the USB settings (see the attached file), but I can only choose between different types of USB, and anyway when I try to select a different setting I get "invalid settings detected"
Attachments
usb.PNG
usb.PNG (24.39 KiB) Viewed 16523 times
FrugoFruit
Posts: 7
Joined: 19. Apr 2017, 13:37

Re: Mouse and Keyboard stopped working on Ubuntu 16.04 guest

Post by FrugoFruit »

Perryg wrote:Try with what Don said and if that does not work create a new test guest and boot the live CD Ubuntu 16.04 and see if the mouse and keyboard still work. Do not change any of the default setting for this test.
I am not sure what he wants me to do :(
When I import my coworker's ubuntu 16.04 vm it works correctly - I can use both the mouse and the keyboard.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Mouse and Keyboard stopped working on Ubuntu 16.04 guest

Post by Perryg »

When I import my coworker's ubuntu 16.04 vm it works correctly
This indicates an issue with the guest then and what I was suspecting. What changed between the time it worked and now? You might be able to boot in recovery mode and salvage this but that will involve you knowing how to repair a Linux OS.
FrugoFruit
Posts: 7
Joined: 19. Apr 2017, 13:37

Re: Mouse and Keyboard stopped working on Ubuntu 16.04 guest

Post by FrugoFruit »

Perryg wrote:
When I import my coworker's ubuntu 16.04 vm it works correctly
This indicates an issue with the guest then and what I was suspecting. What changed between the time it worked and now? You might be able to boot in recovery mode and salvage this but that will involve you knowing how to repair a Linux OS.
Basically only what I wrote in the introduction - in the morning, after picking up the saved state, both mouse and keyboard worked. I simply closed all my apps (like PyCharm and opened terminals) and turned off the vm in order to turn it on afterwards (I did it because the window was weirdly small and my gut reaction was to reboot). After reboot it was already not working.

I am able to boot recovery mode (but only the root terminal). Unfortunately, I am probably not good enough with Ubuntu to perform OS repairs... I guess I'll have to recreate the environment.
To avoid this issue in the future, should I avoid turning off and on the vm? Or perhaps it was the "save state" option that I was overusing?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Mouse and Keyboard stopped working on Ubuntu 16.04 guest

Post by Perryg »

Saved state can come back to bite you as it resemble hibernation and the guest does not really go through a boot up. I would suggest that once you have a working machine just the way you want it. You shut down the guest and copy the entire folder to a secure location so you can easily get back to a working state.
FrugoFruit
Posts: 7
Joined: 19. Apr 2017, 13:37

Re: Mouse and Keyboard stopped working on Ubuntu 16.04 guest

Post by FrugoFruit »

Perryg wrote:Saved state can come back to bite you as it resemble hibernation and the guest does not really go through a boot up. I would suggest that once you have a working machine just the way you want it. You shut down the guest and copy the entire folder to a secure location so you can easily get back to a working state.
Thank you for your help/opinions! :)
If I may ask you one thing, why the "copy folder" thing? I tried that when I moved from pc to laptop (because it was recommended on stackoverflow) and it failed unfortunately. Is it not the purpose of "File -> export/import appliance" option? Or maybe I should use "the "right click on vm -> clone" one?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Mouse and Keyboard stopped working on Ubuntu 16.04 guest

Post by mpack »

FrugoFruit wrote:Is it not the purpose of "File -> export/import appliance" option?
Not any more.

Export/Import appliance is a legacy v3 feature. We deprecate this feature because export followed by import does not produce an exact duplicate VM. If you want an exact duplicate - and if its a backup then you do want that - then copying the folder to secondary storage is the only way.
Post Reply