'Virtualization' tag logo

Common issues when using virtual machines

Qemu issues

Send the Ctrl-Alt-Del key sequence to the guest

The Ctrl-Alt-Del is a special key sequence intercepted by he operating system. Windows use it as a security1 measure to unlock its screen, but in the case of virtualized system an alternative is necessary as the key sequence would be intercepted by the host instead of being sent to the guest.

  • If you are using VNC display, press F8, you should get a menu proposing to send the Ctrl-Alt-Del sequence to the guest.

  • If accessibility tools are available, enable the on-screen keyboard, press Ctrl-Alt on your physical keyboard and click Del on the on-screen keyboard.

  • If accessibility tools are not available, on Windows systems press the Shift key at least five times in a row, you should get a pop-up allowing to enable sticky keys. Now successively press the Ctrl, the Alt and then the Del keys to unlock the screen.

  • Use the command sendkey ctrl-alt-delete in the Qemu Monitor shell. By default this shell can be accessed by pressing Ctrl-Alt-2 (press Ctrl-Alt-1 to go back to guest display), but most Qemu wrapper redirect it. Read the documentation of your particular virtualization software to know how to access the Qemu Monitor shell. With vmtools, use the vmmon(1) command.

Send the Ctrl-Alt-Fn sequence to *nix guests

The Ctrl-Alt-Fn sequence (Where Fn covers function keys usually from F1 to F7) allows to switch from one virtual terminal to another on Unix systems.

  • When using a text-mode terminal (most common situation when this is needed), some systems also accept the Alt-Right and Alt-Left key sequences to move to the next and previous terminal. As long as these key sequences haven’t been affected to something else in your host desktop environment, they should be forwarded as-is to the guest.

  • Otherwise you will have to execute sendkey ctrl-alt-fn on the Qemu Monitor shell, see the Ctrl-Alt-Del case above for more details.

  • Alternatively, if you often need to switch from one terminal to another in text-mode environment, you may want to use a terminal multiplexer such as tmux, the historical screen or the newcomer byobu. Chances are that at least one of those three may be already installed on your system.

The guest does not recognize the network adapter

Qemu and related tools such as GNS3 uses the Intel Gigabit e1000 network adapter by default. This card may not be recognized by some systems, select the Realtek rtl8139 network adapter instead. It is the default adapter selected by the Qemu-KVM project and is usually well recognized by default.

The rtl8139 is a 100 MB/s ethernet adapter, however this shouldn’t really matter as if you really require a fast network access you should switch to virtio (a para-virtualized device) anyway.

Windows 7 remains stuck on the “Starting Windows” screen

For some reason Windows 7 fails to handle standard VGA cards natively (no problem with older systems such as Windows XP or newer ones).

You need to enforce the use of the older cirrus graphical adapter.

The exact procedure depend on the tool you are using. With vanilla Qemu, add the option -vga cirrus. With vmtools, add the option -o vm_display_device=cirrus.

VMware Player issues

Some keyboard keys such as AltGr are ignored by the guest

On some environments, some keys like AltGr may be ignored by the guest.

To solve this, edit the file ~/.vmware/preferences and add the following lines:

xkeymap.keycode.108 = 0x138 # Alt_R
xkeymap.keycode.106 = 0x135 # KP_Divide
xkeymap.keycode.104 = 0x11c # KP_Enter
xkeymap.keycode.111 = 0x148 # Up
xkeymap.keycode.116 = 0x150 # Down
xkeymap.keycode.113 = 0x14b # Left
xkeymap.keycode.114 = 0x14d # Right
xkeymap.keycode.105 = 0x11d # Control_R
xkeymap.keycode.118 = 0x152 # Insert
xkeymap.keycode.119 = 0x153 # Delete
xkeymap.keycode.110 = 0x147 # Home
xkeymap.keycode.115 = 0x14f # End
xkeymap.keycode.112 = 0x149 # Prior
xkeymap.keycode.117 = 0x151 # Next
xkeymap.keycode.78 = 0x46 # Scroll_Lock

Mouse cursor position offset

Sometimes you may have an offset between host’s and the guest’s mouse cursor position.

Using VMware Player in full-screen mode may allow to temporarily solve the issue.

For a more permanent fix, you need to define a fixed screen size in the virtual machine configuration.


  1. This sequence being intercepted by the operating system, requiring it before entering a password makes it hard for a graphical application to fake Windows’ login screen… as long as the user notices the difference with a login prompt not requiring this key sequence at all. 


Popular tags see all

Website

Author

Follow