get screen solution

$ xrandr --verbose
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
XWAYLAND0 connected 1920x1080+0+0 (0x22) normal (normal left inverted right x axis y axis) 480mm x 270mm
    Identifier: 0x21
    Timestamp:  3807
    Subpixel:   unknown
    Gamma:      1.0:1.0:1.0
    Brightness: 0.0
    Clones:
    CRTC:       0
    CRTCs:      0
    Transform:  1.000000 0.000000 0.000000
                0.000000 1.000000 0.000000
                0.000000 0.000000 1.000000
               filter:
  1920x1080 (0x22) 173.000MHz -HSync +VSync *current +preferred
        h: width  1920 start 2048 end 2248 total 2576 skew    0 clock  67.16KHz
        v: height 1080 start 1083 end 1088 total 1120           clock  59.96Hz

screen sharing

setup screen sharing

#!/usr/bin/env bash
export DISPLAY=:0
read -e -p "VNC Password: " -i "ubuntu" password
dconf write /org/gnome/desktop/remote-access/enabled true
dconf write /org/gnome/desktop/remote-access/prompt-enabled false
dconf write /org/gnome/desktop/remote-access/authentication-methods "['vnc']"
dconf write /org/gnome/desktop/remote-access/require-encryption false08/03/2018
dconf write /org/gnome/desktop/remote-access/vnc-password \"\'$(echo -n $password | base64)\'\"
dconf dump /org/gnome/desktop/remote-access/
## sudo service lightdm restart
  • or

    $ read -e -p "VNC Password: " -i "ubuntu" VNCPASSWORD
    $ dconf write /org/gnome/desktop/remote-access/enabled true
    $ dconf write /org/gnome/desktop/remote-access/authentication-methods "['vnc']"
    $ dconf write /org/gnome/desktop/remote-access/prompt-enabled false
    $ dconf write /org/gnome/desktop/remote-access/require-encryption false
    $ dconf write /org/gnome/desktop/remote-access/vnc-password \"\'$(echo -n $VNCPASSWORD | base64)\'\"
    $ sudo service lightdm restart
  • or

    $ vino-preference
    $ dconf-editor

start x server

$ export DISPLAY=:0
$ /usr/lib/vino/vino-server --display=:0 &

backup and restore config

$ dconf dump /org/gnome/desktop/remote-access/ > ubuntu1804_remoteaccess
$ cat ubuntu1804_remoteaccess
[/]
require-encryption=false
vnc-password='bWFyc2xv'
authentication-methods=['vnc']
prompt-enabled=false
$ dconf load /org/gnome/desktop/remote-access/ < ubuntu1804_remoteaccess

read all conf

$ for i in $(gsettings list-keys org.gnome.Vino); do
  echo -e "$i:\t --> "$(dconf read /org/gnome/desktop/remote-access/$i);
done
notify-on-connect:   -->
alternative-port:    -->
disable-background:  -->
use-alternative-port:    -->
icon-visibility:     -->
use-upnp:    -->
view-only:   -->
prompt-enabled:  --> false
disable-xdamage:     -->
authentication-methods:  --> ['vnc']
network-interface:   -->
require-encryption:  --> false
mailto:  -->
lock-screen-on-disconnect:   -->
vnc-password:    --> 'bWFyc2xv'

reset vnc password

$ echo -n 'awesome' | base64
$ gconftool-2 -s -t string /desktop/gnome/remote_access/vnc_password $(echo -n "<YOURPASSWORD>" | base64)
$ gconftool-2 --type string --set /desktop/gnome/remote_acess/vnc_password '123456'
  • or
    $ echo -n "marslo" | base64
    bWFyc2xv

check using wayland or xorg

$ echo $XDG_SESSION_TYPE
  • Ubuntu: Wayland (Wayland)
  • Ubuntu on Xorg: Xorg (X11)

start application remotely

$ export DISPLAY=:0
$ gnome-terminal

gdm

$ cat /lib/systemd/system/gdm.service
[Unit]
Description=GNOME Display Manager

## replaces the getty
Conflicts=getty@tty1.service
After=getty@tty1.service

## replaces plymouth-quit since it quits plymouth on its own
Conflicts=plymouth-quit.service
After=plymouth-quit.service

## Needs all the dependencies of the services it's replacing
## pulled from getty@.service and plymouth-quit.service
## (except for plymouth-quit-wait.service since it waits until
## plymouth is quit, which we do)
After=rc-local.service plymouth-start.service systemd-user-sessions.service

## GDM takes responsibility for stopping plymouth, so if it fails
## for any reason, make sure plymouth still stops
OnFailure=plymouth-quit.service

[Service]
ExecStartPre=/usr/share/gdm/generate-config
ExecStart=/usr/sbin/gdm3
KillMode=mixed
Restart=always
RestartSec=1s
IgnoreSIGPIPE=no
BusName=org.gnome.DisplayManager
StandardOutput=syslog
StandardError=inherit
EnvironmentFile=-/etc/default/locale
ExecReload=/usr/share/gdm/generate-config
ExecReload=/bin/kill -SIGHUP $MAINPID

gnome-shell

autologin

  • login with desired session

    $ cat /var/lib/AccountsService/users/devops
    [User]
    FormatsLocale=en_US.UTF-8
    XSession=gnome-xorg
    SystemAccount=false
    
    [InputSource0]
    xkb=us
  • auto login with gdm

    $ grep -i auto /etc/gdm3/custom.conf
    [daemon]
    ## Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = devops
  • auto login with delay

    $ grep -i time /etc/gdm3/custom.conf
    [daemon]
    ## Enabling timed login
    ##  TimedLoginEnable = true
    ##  TimedLogin = user1
    ##  TimedLoginDelay = 10

login session

desktop styles
1.8.8.2.1 -- desktop styles

default session

$ cat /etc/X11/default-display-manager
/usr/sbin/gdm3

process and subprocesses

pstree

pstree

ps

ps short
ps full

Wayland

$ echo $WAYLAND_DISPLAY
wayland-0

wayland known error

cat <<EOF | sudo tee /etc/xdg/autostart/xhost.desktop
[Desktop Entry]
Name=xhost
Comment=Fix graphical root applications
Exec="xhost +si:localuser:root"
Terminal=false
Type=Application
EOF
Copyright © marslo 2020-2023 all right reserved,powered by GitbookLast Modified: 2024-03-12 15:01:28

results matching ""

    No results matching ""