Aller au contenu principal
Sujet: xhost (Lu 1756 fois) sujet précédent - sujet suivant

xhost

Salut,

j'ai une machine virtuelle Ubuntu. J'aimerais déporter l'affichage d'une application lancée sur Ubuntu vers le serveur d'affichage de ma Leap, en utilisant xhost.

Je me suis inspiré de https://www.suse.com/support/kb/doc/?id=000016314
mais ça ne marche pas.

Alors, quezako ?

PS: c'est juste pour la beauté du geste, les questions de sécurités n'ont aucune importance en l'espèce. Sinon j'utilise ssh -X…

Re : xhost

Répondre #1
Bonsoir,c'est intéressant en effet. Par contre ,ça date un peu: os 10.3.
Ça bloque où chez toi?

Re : xhost

Répondre #2
Concernant le réseau:
Leap(192.168.0.77) -- Virtual-Ubuntu(192.168.0.208)

Préparation:

Sur Leap,
1) j'ai changé ces deux lignes dans /etc/sysconfig/displaymanager:
DISPLAYMANAGER_REMOTE_ACCESS="yes"
DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN="yes"
2) j'ai ouvert le port 6000
3) J'ai redémarré.

Sur Ubuntu,
je n'ai rien fait, sinon vérifié le status du parefeu: inactif.

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

Ensuite j'ai configuré les autorisations de xhost.
Chez Leap (j'ai autorisé tous les clients à se connecter au serveur X de Leap, et dans le doute j'ai aussi ajouté l'IP d'Ubuntu -> la 208):
thierry@toto-PC:~> xhost
access control enabled, only authorized clients can connect
thierry@toto-PC:~> xhost +
access control disabled, clients can connect from any host
thierry@toto-PC:~> xhost 192.168.0.208
192.168.0.208 being added to access control list
thierry@toto-PC:~> xhost
access control disabled, clients can connect from any host
INET:ubuntu

thierry@toto-PC:~> echo $DISPLAY
:0


Chez Virtual-Ubuntu: (J'ai autorisé tous les clients à se connecter au serveur X d'Ubuntu, en particulier l'IP de Leap -> la 77)
thierry@thierry-VirtualBox:~$ xhost
access control enabled, only authorized clients can connect
SI:localuser:thierry
thierry@thierry-VirtualBox:~$ xhost + 192.168.0.77
192.168.0.77 being added to access control list
thierry@thierry-VirtualBox:~$ xhost +
access control disabled, clients can connect from any host
thierry@thierry-VirtualBox:~$ xhost
access control disabled, clients can connect from any host
INET:toto-PC
SI:localuser:thierry

thierry@toto-PC:~> echo $DISPLAY
:0

============================
Et là c'est le drame !

De ma Leap:
thierry@toto-PC:~> xeyes -display 192.168.0.208:0
Error: Can't open display: 192.168.0.208:0

D'Ubuntu:
thierry@thierry-VirtualBox:~$ xeyes -display 192.168.0.77:0
Error: Can't open display: 192.168.0.77:0

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

Je me mélange un peu entre serveur client… Je ne sais pas trop d'où vient le problème.

Re : xhost

Répondre #3
Tu as peut être fait une erreur sur la commande xeyes par rapport au tuto.
Le tuto dit:
xeyes -display <Host-IP>:0.0
Et tu indiques:
xeyes -display <Host-IP>:0
?
 

Re : xhost

Répondre #4
J'obtiens le même message.

De la machine Ubuntu:
thierry@thierry-VirtualBox:~$ xeyes -display 192.168.0.77:0.0
Error: Can't open display: 192.168.0.77:0.0

De ma Leap:
thierry@toto-PC:~> xeyes -display 192.168.0.208:0.0
Error: Can't open display: 192.168.0.208:0.0

man xeyes:
NAME
       xeyes - a follow the mouse X demo

SYNOPSIS
       xeyes [-option ...]

DESCRIPTION
       Xeyes watches what you do and reports to the Boss.

OPTIONS
       -display display
               specify the display to use; see X(7).

J'ai été voir le man de X (zypper in xorgs-docs; man X):
DISPLAY NAMES
       From the user's perspective, every X server has a display name of the form:

              hostname:displaynumber.screennumber

       This information is used by the application to determine how it should connect to the server and which screen it should use by default (on displays with multiple monitors):

       hostname
               The hostname specifies the name of the machine to which the display is physically connected.  If the hostname is not given, the most efficient way of communicating to a server on the same machine will be used.

       displaynumber
               The phrase "display" is usually used to refer to a collection of monitors that share a common set of input devices (keyboard, mouse, tablet, etc.).  Most workstations tend to only have one display.  Larger,  multi-
               user  systems, however, frequently have several displays so that more than one person can be doing graphics work at once.  To avoid confusion, each display on a machine is assigned a display number (beginning at 0)
               when the X server for that display is started.  The display number must always be given in a display name.

       screennumber
               Some displays share their input devices among two or more monitors.  These may be configured as a single logical screen, which allows windows to move across screens, or as individual screens, each  with  their  own
               set of windows.  If configured such that each monitor has its own set of windows, each screen is assigned a screen number (beginning at 0) when the X server for that display is started.  If the screen number is not
               given, screen 0 will be used.

Une ligne intéressante dans le man X:
Finally,  most  X programs accept a command line option of -display displayname to temporarily override the contents of DISPLAY.  This is most commonly used to pop windows on another person's screen or as part of a "remote
       shell" command to start an xterm pointing back to your display.



Re : xhost

Répondre #6
par hasard,y a t-il quelque chose qui bloquerait dans le centre de sécurité de yast?
Dèsolé de ne pas pouvoir t'aider davantage? Je n'utilise pas virtualbox mais gnome boxes qui est vraiment facile d'accès.

Re : xhost

Répondre #7
Oui, il faudrait que je fouille une peu…
Dès que j'ai l'occasion, que l'ordinateur N°2 se libère, je ferai le test sans machine virtuelle.
Je n'ai plus trop le temps là, je verrai plus tard… (sorry)

PS: j'ai aussi essayé en fermant le pare-feu.

Re : xhost

Répondre #8
Bonjour,
Je n'y connais rien.
J'ai juste trouvé ce lien qui semble correspondre :
https://linux.developpez.com/formation_debian/export-display.html
Citer
Export display classique

Le serveur graphique possède une fonction d'export display, mais qui n'est pas cryptée comme avec SSH. Il faut d'abord autoriser les connexions en provenance du serveur X, puis demander au serveur X distant de renvoyer le display vers le serveur X de la machine cliente :
% xhost + serveur.exemple.org
% ssh login@serveur.exemple.org
% export DISPLAY=client.exemple.org:0.0

Note   
Pour que cela marche, il faut que le serveur X de la machine cliente ne soit pas lançée avec l'option -nolisten tcp, ce qui est le cas par défaut !

Si vous utilisez la commande startx, enlevez cette option du fichier /etc/X11/xinit/xserverrc :

#!/bin/sh
exec /usr/bin/X11/X -dpi 100

et redémarrez le serveur X.

Si vous utilisez GDM, enlevez cette option du paramètre command= de la section server-Standard du fichier /etc/gdm/gdm.conf :


[server-Standard]
name=Standard server
command=/usr/bin/X11/X -deferglyphs 16

et redémarrez GDM.
Il doit falloir adapter pour sddm pour KDE

Re : xhost

Répondre #9
Oui, j'avais lu ce tuto.

Chez Opensuse, dans le fichier /etc/sysconfig/displaymanger, il est écrit à la ligne ou il faut passer à yes:
## Type:        yesno
## Default:     no
#
# TCP port 6000 of Xserver. When set to "no" (default) Xserver is
# started with "-nolisten tcp". Only set this to "yes" if you really
# need to. Remote X service should run only on trusted networks and
# you have to disable firewall for interfaces, where you want to
# provide this service. Use ssh X11 port forwarding whenever possible.
#
DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN="no"

Je suppose que quand je le passe à 'yes', l'option '-nolisten tcp' n'est plus valable et que le serveur X (là où je veux afficher) peut écouter sur le port TCP 6000.

Pour le reste, c'est à creuser. Je continue à chercher, mais plus tard.

Sinon, j'ai testé avec deux machines (pas virtuelles) sous Leap 15.2 sur le même réseau: pas mieux.

Il ne doit pas manquer grand chose.