LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 01-29-2019, 09:32 PM   #1
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Rep: Reputation: 145Reputation: 145
Running a virtual machine in it's own virtual console (with no WM)


I've been running various operating systems in KVM virtual machines for some years. It's fun, but the problems of viewing the desktop in a window have always been a little annoying. Even in full-screen mode (on its own desktop in the host's window manager), the linux host is sometimes evident.

But I figured out how to run virt-viewer in its own virtual console such that there are no telltails from the host except the CTRL-ALT-Fn key sequences. For example, to access my Windows 10 virtual machine, I start it with virsh as before and start the viewer like this.

Code:
# Press CTRL-ALT-F6, log in and execute a script with this command
startx /usr/bin/virt-viewer -a -k -r -w -c qemu:///system Windows -- :6 -nolisten tcp
Notice that I'm not even running a window manager. The -k switch on virt-viewer puts it in full screen with a minimal interface. It really feels like the other OS owns the machine. And I can log in and out of the host and the virtual machines independently.

Gosh, this is fun! The only downside is that I haven't figured out how to exit virt-viewer without literally running "kill" from a terminal in a different virtual console.
 
Old 02-01-2019, 12:48 AM   #2
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
enable the ctrl-alt-backspace X exit.
 
Old 02-01-2019, 08:41 PM   #3
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Original Poster
Rep: Reputation: 145Reputation: 145
Quote:
Originally Posted by whansard View Post
enable the ctrl-alt-backspace X exit.
I thought about that, but I didn't know how to do it. And I only want it to work on X servers running virt-viewer, not window manages on the host. (At some point, I'm certain to get confused about which desktop I'm looking at.) It required a deep dive into the unseemly world of X. Also, this this answer helped.

I created file /etc/X11/CtrlAltBksp.conf:
Code:
Section "ServerFlags"
        Option "DontZap" "false"
EndSection
Section "InputClass"
        Identifier "CTRL_ALT_BACKSPACE"
        MatchIsKeyboard "on"
        Option "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection
And my script that starts X specifies that configuration file:
Code:
startx /usr/bin/virt-viewer -a -k -r -w -c qemu:///system Windows -- :6 -config CtrlAltBksp.conf -nolisten tcp -novtswitch
Now, with this setup, CTRL-ALT-Backspace tears down an X server serving virt-viewer, but my host desktop(s) still ignore it.

This keeps getting better!
 
  


Reply

Tags
kvm, virt-viewer, virtual console



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to : Open Virtual Machine Manager to create a new virtual machine BKChicago Linux - Newbie 2 11-08-2016 09:48 PM
Looking For A Bootable OS + Virtual Machine Combo - Bootable Virtual Machine OS Help angelbabycry Linux - Newbie 7 05-08-2015 08:36 PM
how to know the remote machine is Virtual machine or physical machine pantdk Linux - Server 19 10-16-2014 01:48 PM
Is base memory of virtual machine used when virtual machine is not running? ravisingh1 Linux - Virtualization and Cloud 3 04-09-2013 03:41 AM
Running virtual pc files in a virtual machine in linux ... preferably virtual box biharibong Linux - Software 4 01-21-2009 01:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 01:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration