Alpine Linux:如何配置GUI的图形桌面环境:x Desktop Environment

alpine linux 真是不错。小巧、迅捷!

官方的各个版本的alpine镜像内没有带图形环境的。那我们如何构建自己的桌面图形环境呢?

其实:这个问题,在起官网的wiki内有指南,我们根据那些相关文档就可以自己搭建!

--------------------------------------------------------------------

step 1:

localhost:~# setup-xorg-base 
fetch http://mirrors.cloud.tencent.com/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://mirrors.cloud.tencent.com/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
Executing busybox-1.31.1-r9.trigger
Executing eudev-3.2.9-r1.trigger1025-r0)
OK: 101 MiB in 60 packageslibs (3.6.2-r1)
(1/63) Installing libevdev (1.8.0-r0)
(2/63) Installing mtdev (1.1.5-r2)
(3/63) Installing libinput-libs (1.14.3-r0)
(4/63) Installing xf86-input-libinput (0.29.0-r0)
(5/63) Installing encodings (1.0.5-r0)
(6/63) Installing font-alias (1.0.3-r1)
(7/63) Installing libfontenc (1.1.4-r0)
(8/63) Installing libbz2 (1.0.8-r1)
(9/63) Installing libpng (1.6.37-r1)
(10/63) Installing freetype (2.10.1-r0)
(11/63) Installing mkfontscale (1.2.1-r1)
(12/63) Installing expat (2.2.9-r1)
(13/63) Installing fontconfig (2.13.1-r2)
(14/63) Installing pkgconf (1.6.3-r0)
(15/63) Installing util-macros (1.19.2-r1)
(16/63) Installing font-misc-misc (1.1.2-r1)
(17/63) Installing font-cursor-misc (1.0.3-r1)
(18/63) Installing xkeyboard-config (2.28-r0)
(19/63) Installing libxau (1.0.9-r0)
(20/63) Installing libbsd (0.10.0-r0)
(21/63) Installing libxdmcp (1.1.3-r0)
(22/63) Installing libxcb (1.13.1-r0)
(23/63) Installing libx11 (1.6.9-r0)
(24/63) Installing libxkbfile (1.1.0-r0)
(25/63) Installing xkbcomp (1.4.2-r0)
(26/63) Installing libxext (1.3.4-r0)
(27/63) Installing libice (1.0.10-r0)
(28/63) Installing libsm (1.2.3-r0)
(29/63) Installing libxt (1.2.0-r0)
(30/63) Installing libxmu (1.1.3-r0)
(31/63) Installing xauth (1.1-r0)
(32/63) Installing libmount (2.34-r1)
(33/63) Installing libsmartcols (2.34-r1)
(34/63) Installing findmnt (2.34-r1)
(35/63) Installing mcookie (2.34-r1)
(36/63) Installing xmodmap (1.0.10-r0)
(37/63) Installing mcpp-libs (2.7.2-r1)
(38/63) Installing mcpp (2.7.2-r1)
(39/63) Installing xrdb (1.2.0-r0)
(40/63) Installing xinit (1.4.1-r0)
(41/63) Installing mesa (19.2.7-r0)
(42/63) Installing libxdamage (1.1.5-r0)
(43/63) Installing libxfixes (5.0.3-r2)
(44/63) Installing libxxf86vm (1.1.4-r2)
(45/63) Installing libpciaccess (0.16-r0)
(46/63) Installing libdrm (2.4.100-r0)
(47/63) Installing mesa-glapi (19.2.7-r0)
(48/63) Installing libxshmfence (1.3-r0)
(49/63) Installing mesa-gl (19.2.7-r0)
(50/63) Installing libxfont2 (2.0.4-r0)
(51/63) Installing libepoxy (1.5.4-r0)
(52/63) Installing libffi (3.2.1-r6)
(53/63) Installing wayland-libs-server (1.17.0-r0)
(54/63) Installing mesa-gbm (19.2.7-r0)
(55/63) Installing pixman (0.38.4-r0)
(56/63) Installing xorg-server (1.20.6-r0)
(57/63) Installing xf86-video-modesetting (0.9.0-r6)
(58/63) Installing libgcc (9.2.0-r3)
(59/63) Installing libstdc++ (9.2.0-r3)
(60/63) Installing libxml2 (2.9.10-r1)
(61/63) Installing llvm9-libs (9.0.0-r1)
(62/63) Installing mesa-xatracker (19.2.7-r0)
(63/63) Installing xf86-video-vmware (13.3.0-r0)
Executing busybox-1.31.1-r9.trigger
Executing mkfontscale-1.2.1-r1.trigger
Executing fontconfig-2.13.1-r2.trigger
OK: 190 MiB in 123 packages
 * Caching service dependencies ...                                                         [ ok ]
 * Starting udev ...                                                                        [ ok ]
 * Generating a rule to create a /dev/root symlink ...                                      [ ok ]
 * Populating /dev with existing devices through uevents ...                                [ ok ]
 * Waiting for uevents to be processed ...                                                  [ ok ]
localhost:~#

step 2:

localhost:~# apk add xf86-input-keyboard xf86-input-mouse xf86-video-vmware xf86-input-vmmouse
(1/3) Installing xf86-input-keyboard (1.9.0-r1)
(2/3) Installing xf86-input-mouse (1.9.3-r1)
(3/3) Installing xf86-input-vmmouse (13.1.0-r4)
Executing busybox-1.31.1-r9.trigger
Executing eudev-3.2.9-r1.trigger
OK: 191 MiB in 128 packages
localhost:~#

 

step 3:

localhost:~# apk add dbus
(1/3) Installing dbus-libs (1.12.16-r2)
(2/3) Installing dbus (1.12.16-r2)
Executing dbus-1.12.16-r2.pre-install
(3/3) Installing dbus-openrc (1.12.16-r2)
Executing busybox-1.31.1-r9.trigger
OK: 192 MiB in 131 packages
localhost:~# rc-service  dbus start
 * Caching service dependencies ...                                                         [ ok ]
 * Starting System Message Bus ...
localhost:
~# rc-update add dbus * service dbus added to runlevel default

 

step 4:

localhost:~# apk add lightdm
(1/49) Installing libintl (0.20.1-r2)
(2/49) Installing pcre (8.43-r0)
(3/49) Installing glib (2.62.4-r0)
(4/49) Installing icu-libs (64.2-r0)
(5/49) Installing nspr (4.24-r0)
(6/49) Installing readline (8.0.1-r0)
(7/49) Installing mozjs60 (60.9.0-r0)
(8/49) Installing linux-pam (1.3.1-r1)
(9/49) Installing polkit (0.116-r0)
Executing polkit-0.116-r0.pre-install
(10/49) Installing accountsservice (0.6.55-r0)
(11/49) Installing ttf-cantarell (0.111-r0)
(12/49) Installing libxrender (0.9.10-r3)
(13/49) Installing cairo (1.16.0-r2)
(14/49) Installing libcroco (0.6.13-r1)
(15/49) Installing shared-mime-info (1.15-r0)
(16/49) Installing libjpeg-turbo (2.0.4-r0)
(17/49) Installing tiff (4.1.0-r0)
(18/49) Installing gdk-pixbuf (2.40.0-r0)
(19/49) Installing libxft (2.3.3-r0)
(20/49) Installing fribidi (1.0.8-r0)
(21/49) Installing graphite2 (1.3.13-r1)
(22/49) Installing harfbuzz (2.6.4-r0)
(23/49) Installing pango (1.44.7-r0)
(24/49) Installing librsvg (2.46.4-r0)
(25/49) Installing hicolor-icon-theme (0.17-r1)
(26/49) Installing gtk-update-icon-cache (2.24.32-r1)
(27/49) Installing libxcomposite (0.4.5-r0)
(28/49) Installing libxcursor (1.2.0-r0)
(29/49) Installing libxi (1.7.10-r0)
(30/49) Installing libxrandr (1.5.2-r0)
(31/49) Installing atk (2.34.1-r0)
(32/49) Installing avahi-libs (0.7-r4)
(33/49) Installing gmp (6.1.2-r1)
(34/49) Installing nettle (3.5.1-r0)
(35/49) Installing p11-kit (0.23.18.1-r0)
(36/49) Installing libtasn1 (4.15.0-r0)
(37/49) Installing libunistring (0.9.10-r0)
(38/49) Installing gnutls (3.6.10-r0)
(39/49) Installing cups-libs (2.2.12-r1)
(40/49) Installing gtk+2.0 (2.24.32-r1)
Executing gtk+2.0-2.24.32-r1.post-install
(41/49) Installing adwaita-gtk2-theme (3.28-r1)
(42/49) Installing gnome-themes-extra (3.28-r1)
(43/49) Installing adwaita-icon-theme (3.34.3-r0)
(44/49) Installing libgpg-error (1.36-r2)
(45/49) Installing libgcrypt (1.8.5-r0)
(46/49) Installing iso-codes (4.4-r0)
(47/49) Installing libxklavier (5.4-r5)
(48/49) Installing lightdm (1.30.0-r0)
Executing lightdm-1.30.0-r0.pre-install
(49/49) Installing lightdm-openrc (1.30.0-r0)
Executing busybox-1.31.1-r9.trigger
Executing dbus-1.12.16-r2.trigger
Executing fontconfig-2.13.1-r2.trigger
Executing shared-mime-info-1.15-r0.trigger
Executing gdk-pixbuf-2.40.0-r0.trigger
Executing gtk-update-icon-cache-2.24.32-r1.trigger
Executing mkfontscale-1.2.1-r1.trigger
OK: 332 MiB in 180 packages
localhost:~#
localhost:~# rc-service lightdm start
 * Caching service dependencies ...                                                         [ ok ]
 * /run/lightdm: creating directory
 * /run/lightdm: correcting owner
 * Starting Display Manager ...                                                             [ ok ]
localhost:~# rc-update add lightdm
 * service lightdm added to runlevel default
localhost:~#
localhost:/var/log/lightdm# apk add lightdm-gtk-greeter
(1/1) Installing lightdm-gtk-greeter (2.0.7-r0)
Executing busybox-1.31.1-r9.trigger
Executing gtk-update-icon-cache-2.24.32-r1.trigger
OK: 389 MiB in 235 packages
localhost:/var/log/lightdm#

 

step 5:

localhost:/etc/apk# apk add xfce4
(1/38) Installing libxfce4util (4.14.0-r0)
(2/38) Installing exo-libs (0.12.11-r0)
(3/38) Installing xcb-util (0.4.0-r1)
(4/38) Installing startup-notification (0.12-r3)
(5/38) Installing xfconf (4.14.1-r0)
(6/38) Installing libxfce4ui-gtk3 (4.14.1-r0)
(7/38) Installing exo (0.12.11-r0)
(8/38) Installing libxfce4ui (4.14.1-r0)
(9/38) Installing garcon (0.6.4-r0)
(10/38) Installing desktop-file-utils (0.24-r0)
(11/38) Installing libexif (0.6.21-r3)
(12/38) Installing libgudev (233-r0)
(13/38) Installing libnotify (0.7.8-r0)
(14/38) Installing libxres (1.2.0-r1)
(15/38) Installing libwnck3 (3.32.0-r1)
(16/38) Installing xfce4-panel (4.14.1-r0)
(17/38) Installing thunar (1.8.11-r0)
Executing thunar-1.8.11-r0.post-install
(18/38) Installing ca-certificates (20191127-r0)
(19/38) Installing nghttp2-libs (1.40.0-r0)
(20/38) Installing libcurl (7.67.0-r0)
(21/38) Installing lcms2 (2.9-r1)
(22/38) Installing openjpeg (2.3.1-r2)
(23/38) Installing poppler (0.82.0-r1)
(24/38) Installing poppler-glib (0.82.0-r1)
(25/38) Installing tumbler (0.2.7-r1)
(26/38) Installing ttf-dejavu (2.37-r1)
(27/38) Installing xfce4-appfinder (4.14.0-r0)
(28/38) Installing libusb (1.0.23-r0)
(29/38) Installing upower (0.99.11-r0)
(30/38) Installing xfce4-power-manager (1.6.5-r0)
(31/38) Installing iceauth (1.0.8-r0)
(32/38) Installing dbus-x11 (1.12.16-r2)
(33/38) Installing xfce4-session (4.14.0-r0)
(34/38) Installing xfce4-settings (4.14.1-r0)
(35/38) Installing xfdesktop (4.14.1-r0)
(36/38) Installing libxpresent (1.0.0-r0)
(37/38) Installing xfwm4 (4.14.0-r0)
(38/38) Installing xfce4 (4.14_pre1-r0)
Executing busybox-1.31.1-r9.trigger
Executing eudev-3.2.9-r1.trigger
Executing fontconfig-2.13.1-r2.trigger
Executing gtk-update-icon-cache-2.24.32-r1.trigger
Executing mkfontscale-1.2.1-r1.trigger
Executing desktop-file-utils-0.24-r0.trigger
Executing ca-certificates-20191127-r0.trigger
OK: 389 MiB in 233 packages
localhost:/etc/apk#

 

 

step 6:重启
step 7:在控制台中执行:startx 或 startxfce4

 

 

 

--------------------------------------------------------------------

http://wiki.alpinelinux.org/wiki/Tutorials_and_Howtos   之第5章 :  Desktop Environment

里面详细描述了以下桌面环境的安装配置,我们参照执行即可:

Desktop Environment

-------------------------------------------------------------------------------------------------------------------------------

 我成功搭建了 mate、xfce4、remote desktop server (隐含 vino VNC 环境)环境。

提示:

1: 安装xfce4桌面环境,特别要注意需要安装 xfce4-notifyd 组件,否则应用的弹出信息看不到! 比如后续安装xrdp就一致无法成功,原因在此。

2:必须安装一个linux的x登录shell环境:如 lxdm,否则只能手工startx。todo:alpine内容如何直接执行startx代替默认的openrc 文本登录界面,待解决。

3:lxdm安装后,需要通过rc-update add lxdm服务,否则如同2,不能自动打开lxdm的登录界面

4:lxdm 如何让root或其他用户登录,并自动运行某些服务或程序? 

     修改:/etc/lxdm/lxdm.conf 文件实现自动用户登录

     

 1 [base]                                                                                                          
 2 ## uncomment and set autologin username to enable autologin                                                     
 3 autologin=root                                                                                                  
 4                                                                                                                 
 5 ## uncomment and set timeout to enable timeout autologin,                                                       
 6 ## the value should >=5                                                                                         
 7 # timeout=10                                                                                                    
 8                                                                                                                 
 9 ## default session or desktop used when no systemwide config                                                    
10 # session=/usr/bin/startlxde                                                                                    
11                                                                                                                 
12 ## uncomment and set to set numlock on your keyboard                                                            
13 # numlock=0                                                                                                     
14                                                                                                                 
15 ## set this if you don't want to put xauth file at ~/.Xauthority                                                
16 # xauth_path=/tmp                                                                                               
17                                                                                                                 
18 # not ask password for users who have empty password                                                            
19 # skip_password=1                                                                                               
20            

  修改:/etc/lxdm/PostLogin 文件实现登录用户后,自动运行服务或程序。我自动开启xrdp服务的配置如下

#!/bin/sh
#
# Note: this is a sample and will not be run as is.

rc-service xrdp restart
rc-service xrdp-sesman restart
rc-service vino restart

 

ok。到此结束!

 

 

posted on 2018-02-05 16:40  jinzhenshui  阅读(11942)  评论(0编辑  收藏  举报