Mailing List Archive

XL Console: Accessing DomU Guis?
Goal:

I am trying to run 2 graphical environments ("guis"), KDE Plasma &
Windows 7, on a machine where the Xen hypervisor runs and where I can
access the guis on the monitor attached to the machine. I want to have
the machine act as a workstation giving me the ability to switch between
Gentoo & Win7 (Win for legacy Adobe products with I *own*) using the "xl
console" command. I believe I want SDL. I do not want the VNC delay.

============================================

My guest VM, ryzdesk [desktop] herein "DomU" has KDE Plasma installed
and I can successfully launch tiger VNC within DomU and access the KDE
desktop through through VNC from a remote machine.


I have tried the following:

1) In Dom0, launch as root Xfce4

2) In a console within Xfce4,
     start the DomU: "xl create ryzdesk.conf -c"

3) In the DomU console, log in as root. Run:
    xinit
   to launch the KDE desktop.

4) switch out of the DomU console with Ctrl+"]"

5) In the same Xfce4 console now activated in DomU,
   use: "xl console [#]" to jump into DomU.

When I am in the DomU session, nothing happens, there are only the
messages from the start of xinit. No KDE desktop pops up and replaced my
Xfce desktop. I then enter Ctrl + "c" to terminate the attempted launch
of the KDE desktop.  Log is below.

Xorg log file from an attempt to launch xinitc. In a prior attempt, I
waited 3 minutes after output on the display before I executed
Control-C; in this log, I only waited for about 20 seconds:

https://salemdata.us/xen/guis/Xorg.0._20240103_1741PST.log

I believe the ability to access the guis from Dom0 would be achieved by
selecting SDL in the configuration and executing the "xl console"
command from within a console on a gui. From my configurations file,
ryzdesk.conf:


   ...
   vfb = [ 'type=sdl' ]
   ...
   # ref: https://www.youtube.com/watch?v=s1Ro0KxHooQ
   #
   videoram=16
   stdvga=1
   sdl = 1
   vnc = 0

The new hardware consists of:

  AMD Ryzen 7950+ processor
  ASRock X670E motherboard
  64 GB ram (non-ECC)

  Video:
    monitor: ViewSonic VA1655 15.6 Inch 1080p Portable IPS Monitor
    port: HDMI of motherboard

Operating system for Dom0 and DomU (same kernel)

    Gentoo Linux: 6.1.67-gentoo-x86_64

The VNC session demonstrates that the KDE Plasma desktop does work
-- I have been using the KDE desktop through VNC.

Here are links to the version of Xen (4.16.6_pre1) and Qemu I have
installed:

https://salemdata.us/xen/guis/qemu.script.202401031643PST.html
https://salemdata.us/xen/guis/xen.script.202401031643PST.html

Here is a dmesg listing with the Xorg.0.log of my attempt to
to start the KDE desktop.

https://salemdata.us/xen/guis/dmesg_ryzdesk_20240103_1936PST.script.html

1) Is my expectation that Xen will allow me to access guest desktops in
a gui fashion from a Dom0 console unrealistic?

2) What can I reference and/or provide to help troubleshoot the failure
to access a full gui of a guest VM on the hypervisor's monitor?

I've spent several days trying to get this to work, all the while a
colleague
murmurs "just use kvm".  I've been using Xen for over a decade and would
like to continue using Xen.

Thank you for your time,

John Poole
Re: XL Console: Accessing DomU Guis? [ In reply to ]
Hey John,

I have never used SDL so far and I am not an experienced KDE/Xfce user
(my DomUs are mostly headless), so please take my reply with caution.

Am 04.01.2024 um 04:47 schrieb John L. Poole:
> Goal:
>
> I am trying to run 2 graphical environments ("guis"), KDE Plasma &
> Windows 7, on a machine where the Xen hypervisor runs and where I can
> access the guis on the monitor attached to the machine. I want to have
> the machine act as a workstation giving me the ability to switch between
> Gentoo & Win7 (Win for legacy Adobe products with I *own*) using the "xl
> console" command. I believe I want SDL. I do not want the VNC delay.

I don't think "xl console" works in the way you want to use it, see below.

> ============================================
>
> My guest VM, ryzdesk [desktop] herein "DomU" has KDE Plasma installed
> and I can successfully launch tiger VNC within DomU and access the KDE
> desktop through through VNC from a remote machine.

I assume from what you have written that you are running a TigerVNC
server instance in the DomU. If you use the VNC option built into Xen
(provided via QEMU, I belive), you don't need to use TigerVNC on the DomU.

>
> I have tried the following:
>
> 1) In Dom0, launch as root Xfce4
>
> 2) In a console within Xfce4,
>      start the DomU: "xl create ryzdesk.conf -c"
>
> 3) In the DomU console, log in as root. Run:
>     xinit
>    to launch the KDE desktop.
>
> 4) switch out of the DomU console with Ctrl+"]"
>
> 5) In the same Xfce4 console now activated in DomU,
>    use: "xl console [#]" to jump into DomU.
>
> When I am in the DomU session, nothing happens, there are only the
> messages from the start of xinit. No KDE desktop pops up and replaced my
> Xfce desktop. I then enter Ctrl + "c" to terminate the attempted launch
> of the KDE desktop.  Log is below.

My understanding is that the Dom0 _console_ simply can't display the GUI
from the DomU. "xl console" does what it says, it shows the console of
the DomU. The output of the DomU console after starting xinit shows that
this is working as intended. "xl create" with the "-c" option is
equivalent to using "xl console". Also, a Dom0 console is not
"activated" by the DomU in any way, I think a DomU influencing the Dom0
in such a way would violate the security aspect of virtualization.

GUI content from the DomU, be it transmitted via VNC or SDL or whatever,
needs to be shown in a separate window in a GUI. Also, your Xfce desktop
will not be "replaced" by anything. Xfce still is required for Dom0 to
be able to render the windows in which the DomU GUI is shown.

If you have two DomUs you want to switch between (e. g. your Linux/KDE
and your Windows DomU), you will have two separate Windows in your Dom0
Xfce GUI between which you can switch.

> Xorg log file from an attempt to launch xinitc. In a prior attempt, I
> waited 3 minutes after output on the display before I executed
> Control-C; in this log, I only waited for about 20 seconds:
>
> https://salemdata.us/xen/guis/Xorg.0._20240103_1741PST.log
>
> I believe the ability to access the guis from Dom0 would be achieved by
> selecting SDL in the configuration and executing the "xl console"
> command from within a console on a gui. From my configurations file,
> ryzdesk.conf:
>
>
>    ...
>    vfb = [ 'type=sdl' ]
>    ...
>    # ref: https://www.youtube.com/watch?v=s1Ro0KxHooQ
>    #
>    videoram=16
>    stdvga=1
>    sdl = 1
>    vnc = 0


Two aspects come to my mind here:

1) There seem to be different options for SDL depending on the type of
the DomU (PV or HVM). You seem to be setting options for both versions.
Perhaps they get in the way of each other? See here:
https://xenbits.xen.org/docs/unstable/man/xl.cfg.5.html

2) In the video you referenced, my point from above is confirmed: With
starting the DomU, a separate X window opens automatically, the GUI of
the DomU is _not_ shown in the terminal window. In fact, no "xl console"
is ever executed.

> The new hardware consists of:
>
>   AMD Ryzen 7950+ processor
>   ASRock X670E motherboard
>   64 GB ram (non-ECC)
>
>   Video:
>     monitor: ViewSonic VA1655 15.6 Inch 1080p Portable IPS Monitor
>     port: HDMI of motherboard
>
> Operating system for Dom0 and DomU (same kernel)
>
>     Gentoo Linux: 6.1.67-gentoo-x86_64
>
> The VNC session demonstrates that the KDE Plasma desktop does work
> -- I have been using the KDE desktop through VNC.
>
> Here are links to the version of Xen (4.16.6_pre1) and Qemu I have
> installed:
>
> https://salemdata.us/xen/guis/qemu.script.202401031643PST.html
> https://salemdata.us/xen/guis/xen.script.202401031643PST.html
>
> Here is a dmesg listing with the Xorg.0.log of my attempt to
> to start the KDE desktop.
>
> https://salemdata.us/xen/guis/dmesg_ryzdesk_20240103_1936PST.script.html
>
> 1) Is my expectation that Xen will allow me to access guest desktops in
> a gui fashion from a Dom0 console unrealistic?
>
> 2) What can I reference and/or provide to help troubleshoot the failure
> to access a full gui of a guest VM on the hypervisor's monitor?

Do the Xen/QEMU logs on your Dom0 say anything relevant, e. g. about
failing to start SDL?

Good luck!

Paul
Re: XL Console: Accessing DomU Guis? [ In reply to ]
Paul, thank you for your responses and consideration of my issue.

I just want to confirm I am trying to follow the desired protocol
for email responses as outlined at:
https://xenproject.org/help/mailing-list/

    Post in plain text (i.e. not HTML), word-wrapped to somewhere
    around 72 characters.

    Don’t top-post: reply in-line below the text you’re replying to.

    Trim the quoted material in your reply to only include the bits
    you are responding to.

I am responding to your responses inline below.
On 1/4/2024 1:48 AM, Paul Leiber wrote:
> <snip>
> I assume from what you have written that you are running a
> TigerVNC server
> instance in the DomU. If you use the VNC option built into Xen
> (provided via QEMU, I belive), you don't need to use TigerVNC
> on the DomU.

I found this statement as SUSE's site under the section entitled
"Managing Virtual Machines with Xen":

   22.3.2 Using SDL instead of a VNC Viewer

   If you access a virtual machine's display from the virtual
   machine host console (known as local or on-box access),
   you should use SDL instead of VNC viewer.
   VNC viewer is faster for viewing desktops over a network,
   but SDL is faster for viewing desktops from the same computer.

   Source:
https://documentation.suse.com/sles/12-SP5/html/SLES-all/cha-xen-config.html

> <snip>
> My understanding is that the Dom0 _console_ simply can't display
> the GUI from the DomU. "xl console" does what it says, it shows
> the console of the DomU. The output of the DomU console after starting
> xinit shows that this is working as intended. "xl create" with
> the "-c" option is equivalent to using "xl console". Also, a Dom0
> console is not "activated" by the DomU in any way, I think a DomU
> influencing the Dom0 in such a way would violate the security aspect
> of virtualization.
Correct.  I have not be careful with my terminology.  What I envision
is running Xfce in Dom0 as user jlpoole, and then within the Xfce
session, launching a console within and executing the command:
"sudo xl console [X]".  This procedure should be distinguished
from being in the console window at boot time and trying therein
"sudo xl console [X]" where I am not operating over an
already-launched gui.

>
> GUI content from the DomU, be it transmitted via VNC or SDL or

> whatever, needs to be shown in a separate window in a GUI.
> Also, your Xfce desktop will not be "replaced" by anything.
> Xfce still is required for Dom0 to be able to render the windows
> in which the DomU GUI is shown.
Agreed.
>
> If you have two DomUs you want to switch between (e. g. your
> Linux/KDE and your Windows DomU), you will have two separate
> Windows in your Dom0 Xfce GUI between which you can switch.
Yes, agreed.
>
>> Xorg log file from an attempt to launch xinitc. In a prior attempt, I
>> waited 3 minutes after output on the display before I executed
>> Control-C; in this log, I only waited for about 20 seconds:
>>
>> https://salemdata.us/xen/guis/Xorg.0._20240103_1741PST.log
>>
>> I believe the ability to access the guis from Dom0 would be achieved by
>> selecting SDL in the configuration and executing the "xl console"
>> command from within a console on a gui. From my configurations file,
>> ryzdesk.conf:
>>
>>
>>     ...
>>     vfb = [ 'type=sdl' ]
>>     ...
>>     # ref: https://www.youtube.com/watch?v=s1Ro0KxHooQ
>>     #
>>     videoram=16
>>     stdvga=1
>>     sdl = 1
>>     vnc = 0
>
>
> Two aspects come to my mind here:
>
> 1) There seem to be different options for SDL depending on the
> type of the DomU (PV or HVM).
> You seem to be setting options for both versions. Perhaps
> they get in the way of each other?
> See here: https://xenbits.xen.org/docs/unstable/man/xl.cfg.5.html

I will look into this more and try to figure out the nuances.
I was hoping by posting here I might garner the attention
of somebody who runs the kind of configuration I want to do
and I would be directed with some simple instructions or
someone would point out what I have missed or overlooked.
>
> 2) In the video you referenced, my point from above is
> confirmed: With starting the DomU, a separate X window
> opens automatically, the GUI of the DomU is _not_ shown
> in the terminal window. In fact, no "xl console" is ever executed.

Correct.  I tried to launch my Windows 7 ISO, but have run into
other problems with my qemu complaining about being unable
to find i386 stuff... I think it is a bug Gentoo's distribution
has caused and need to file a bug according for the
file complained of is, in fact, present on my system, it just
is in another directory.
Gentoo often has these kind of change-the-directory to suit Gentoo's
philosophy and then some other software expect to find a file in a
directory where Gentoo's installer changed it.
> <snip>
> Do the Xen/QEMU logs on your Dom0 say anything relevant,
> e. g. about failing to start SDL?
>
I did not see anything.
<snip>

John
Re: XL Console: Accessing DomU Guis? [ In reply to ]
Hi,

On 06 Jan 2024 20:18, John L. Poole wrote:

> > My understanding is that the Dom0 _console_ simply can't display
> > the GUI from the DomU. "xl console" does what it says, it shows
> > the console of the DomU. The output of the DomU console after starting
> > xinit shows that this is working as intended. "xl create" with
> > the "-c" option is equivalent to using "xl console". Also, a Dom0
> > console is not "activated" by the DomU in any way, I think a DomU
> > influencing the Dom0 in such a way would violate the security aspect
> > of virtualization.
> Correct.  I have not be careful with my terminology.  What I envision
> is running Xfce in Dom0 as user jlpoole, and then within the Xfce
> session, launching a console within and executing the command:
> "sudo xl console [X]".  This procedure should be distinguished
> from being in the console window at boot time and trying therein
> "sudo xl console [X]" where I am not operating over an
> already-launched gui.

I think you misunderstand the way it works.
"xl console", or more generally a "console", is just a *text* interface,
it cannot display a GUI, only a TUI (Text User Interface).
In a way, the console can only display what would be displayed on
tty1-tty6, but not tty7 (where the GUI usually resides).
(In effect, [xl] console displays tty1, and tty1 only).

For graphics *and* without installing anything in the domU, you have 2
choices: VNC or SDL.

Xen (for PV) or QEMU (for HVM) provide a VNC server to access the video
output of your domU, but VNC is not installed in the domU !

Some analogy: a real computer has a videocard, a cable and a monitor,
whereas virtualized hosts have a virtual videocard (vfb or emulated),
and VNC or SDL "replace/virtualize" the cable and the monitor.

If you want to access the VNC display with the Xen commands, run :
xl vncviewer $domU_id_or_name

Of course, you need at least one VNC *viewer* installed in dom0
(gvncviewer, tigervnc, virt-viewer, etc).

With SDL, the (GUI) window starts automatically with the domU, but
remember that closing the SDL window will shutdown the domU !

> >>     ...
> >>     vfb = [ 'type=sdl' ]
> >>     ...
> >>     # ref: https://www.youtube.com/watch?v=s1Ro0KxHooQ
> >>     #
> >>     videoram=16
> >>     stdvga=1
> >>     sdl = 1
> >>     vnc = 0
> >
> >
> > Two aspects come to my mind here:
> >
> > 1) There seem to be different options for SDL depending on the
> > type of the DomU (PV or HVM).
> > You seem to be setting options for both versions. Perhaps
> > they get in the way of each other?
> > See here: https://xenbits.xen.org/docs/unstable/man/xl.cfg.5.html
>
> I will look into this more and try to figure out the nuances.
> I was hoping by posting here I might garner the attention
> of somebody who runs the kind of configuration I want to do
> and I would be directed with some simple instructions or
> someone would point out what I have missed or overlooked.

As Paul wrote, the configuration depends if your domUs are HVM or PV.
The "vfb" stanza is used for PV/PVH guests *only*, not HVM.
"vfb" means Virtual FrameBuffer, it is the PV equivalent of the emulated
videocard of the HVM domUs.
So, config stanzas :
PV/H -> vfb =
HVM -> vga =

For Windows, which has to be HVM, your config for SDL would be :
# VIDEO CARD
vga = "stdvga"
videoram = 128
# REMOTE ACCESS
sdl = 1
opengl = 1

If you want VNC instead :
# VIDEO CARD
vga = "stdvga"
videoram = 128
# REMOTE ACCESS
vnc = 1
vnclisten = "127.0.0.1:7"
# OR, if you want to access the domU GUI from your network, use the IP
of the dom0 NIC connected to your local network, for example :
# vnclisten = "192.168.1.1:7"

AFAIK, QEMU provides *either* VNC *or* SDL, but not both at the same
time, so if you want to use SDL from your dom0 *and* be able to connect
to your domU from remote hosts as well, then you'd have to also install
VNC *within* the domU (like you would do with any non-virtualized host).

> >
> > 2) In the video you referenced, my point from above is
> > confirmed: With starting the DomU, a separate X window
> > opens automatically, the GUI of the DomU is _not_ shown
> > in the terminal window. In fact, no "xl console" is ever executed.
>
> Correct.  I tried to launch my Windows 7 ISO, but have run into
> other problems with my qemu complaining about being unable
> to find i386 stuff... I think it is a bug Gentoo's distribution
> has caused and need to file a bug according for the
> file complained of is, in fact, present on my system, it just
> is in another directory.
> Gentoo often has these kind of change-the-directory to suit Gentoo's
> philosophy and then some other software expect to find a file in a
> directory where Gentoo's installer changed it.

You seem to know what the problem is, so just a remark: did you install
the correct QEMU packages ? I'm using Debian so I don't know how it's
handled in Gentoo, but at some point the QEMU packages in Debian have
been split between GUI and non-GUI packages (to reduce the number of
dependencies on X/GUI stuff for servers).
For example on Debian, to use the SDL you need the package
"qemu-system-gui". YMMV !

Hope it helps.

--
++
zithro / Cyril
Re: XL Console: Accessing DomU Guis? [ In reply to ]
Am 07.01.2024 um 20:25 schrieb zithro:
> Hi,
>
> On 06 Jan 2024 20:18, John L. Poole wrote:
>
>>  > My understanding is that the Dom0 _console_ simply can't display
>>  > the GUI from the DomU. "xl console" does what it says, it shows
>>  > the console of the DomU. The output of the DomU console after starting
>>  > xinit shows that this is working as intended. "xl create" with
>>  > the "-c" option is equivalent to using "xl console". Also, a Dom0
>>  > console is not "activated" by the DomU in any way, I think a DomU
>>  > influencing the Dom0 in such a way would violate the security aspect
>>  > of virtualization.
>> Correct.  I have not be careful with my terminology.  What I envision
>> is running Xfce in Dom0 as user jlpoole, and then within the Xfce
>> session, launching a console within and executing the command:
>> "sudo xl console [X]".  This procedure should be distinguished
>> from being in the console window at boot time and trying therein
>> "sudo xl console [X]" where I am not operating over an
>> already-launched gui.
>
> I think you misunderstand the way it works.
> "xl console", or more generally a "console", is just a *text* interface,
> it cannot display a GUI, only a TUI (Text User Interface).
> In a way, the console can only display what would be displayed on
> tty1-tty6, but not tty7 (where the GUI usually resides).
> (In effect, [xl] console displays tty1, and tty1 only).
>
> For graphics *and* without installing anything in the domU, you have 2
> choices: VNC or SDL.

Just for completeness' sake: At least for HVM DomUs, there is also
SPICE, which I have been using more often than VNC, lately.

https://wiki.xenproject.org/wiki/SPICE_support_in_Xen

Paul