Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to run Linux Desktop with docker

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

In this issue, Xiaobian will bring you about how to run Linux desktop with docker. The article is rich in content and analyzes and narrates from a professional perspective. After reading this article, I hope you can gain something.

The container pandemic has made many things virtual and containerized. A lot of people want to do more, run the entire OS in containers, and use containers as virtual machines. Generally speaking, this idea is not recommended, but it is not impossible.

overview

Webtops projects run counter to the usual short, single-function Docker philosophy, but they have to be functional. The project requires the following services to run in containers:

(1)Guacamole Server: A clientless remote desktop gateway under the Apache Foundation. This is the key to enabling Web(browser) access to remote desktops.

(2)xrdp Server: Provides graphical login for remote computers using RDP(Microsoft Remote Desktop Protocol). xrdp accepts connections from RDP clients of various platforms, including reeRDP, rdesktop, NeutrinoRDP and Microsoft Remote Desktop Client.

(3)Pulseaudio: A cross-platform voice service that works over the web.

(4) Custom nodejs frontend:

(5)Webtops projects can:

Perfect resolution for pixel rendering

Basic window manager

audio support

Use RDP protocol

clipboard support

On-screen keyboard support

Remote file upload/download management

Webtops was designed with containerization in mind and developed with the basic mirror design concept, so it supports application extensions and can easily embed any Linux GUI application. In a desktop environment, users can install specific packages on demand and customize them according to their needs.

installation and deployment

Because it is based on containerized deployment, installation is very simple, and deployment can be completed directly with a docker command:

docker run -d \ --name=webtop \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Europe/London \ -p 3000:3000 \ -v /path/to/data:/config \ --shm-size="1gb" \ --restart unless-stopped \ ghcr.io/linuxserver/webtop

Then you can access it through your browser: localhost:3000, this is the Alpine XFCE desktop environment:

On the left side of the screen is an arrow that can be used to expand the menu of some of the built-in remote interaction features or to open and close this menu using ctrl + alt + shift:

From the pop-up menu, you can launch the file browser, pop-up soft keyboard (for mobile phones or touchpads) and clipboard.

File browser, directly to achieve the user's current system and remote system file upload download and other operations.

The contents of the user's current clipboard are copied to the clipboard box before they can be used later on the remote machine.

preferences

Ubuntu is currently supported in addition to Alpine. Supported desktop systems include:

XFCE

KDE

MATE

i3

Openbox

IceWM

access authentication

By default, mirroring is enabled for abc users and can be accessed without authentication. The default password for abc users is abc. If you want to change this password and enable authentication when accessing the interface, you need to do so by executing on the server:

docker exec -it webtop passwd abc

Then go to localhost:3000/? login=true Access

By default, the xrdp login manager opens, where you can enter your username and password.

update

As mentioned earlier, containerized Linux desktop environments actually run counter to the classic Docker philosophy, so it is strongly recommended not to use Docker to process images for updates. You can update the system using the operating system's package management

Apk for Alpine:

sudo apk upgrade

Ubuntu uses apt:

sudo apt-get update && sudo apt-get dist-upgrade-y custom build image

In order to embed the required APP in the base image, for example, to add Firefox containers Example Dockerfile:

FROM lsiobase/rdesktop-web:alpine RUN \ echo "**** install packages ****" && \ apk add --no-cache \ firefox-esr && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* # add local files COPY /root / # ports and volumes EXPOSE 3000 VOLUME /config

In addition to installing the application, you need to add the firefox launch point to the startup file/root/defaults/autostart.

That's it, when the container starts, Firefox will launch in the basic Openbox gui:

There is also a Dockerfile file for LibreOffice applications as follows:

FROM lsiobase/rdesktop-web:alpine # set version label ARG BUILD_DATE ARG VERSION ARG LIBREOFFICE_VERSION LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="thelamer" RUN \ echo "**** install packages ****" && \ apk add --no-cache --virtual=build-dependencies \ curl && \ if [ -z ${LIBREOFFICE_VERSION+x} ]; then \ LIBREOFFICE_VERSION=$(curl -sL "dl-cdn.alpinelinux.org/alpine/v3.13/community/x86_64/APKINDEX.tar.gz"| tar -xz -C /tmp \ && awk '/^P:libreoffice$/,/V:/' /tmp/APKINDEX | sed -n 2p |sed 's/^V://');\ fi && \ apk add --no-cache \ libreoffice==${LIBREOFFICE_VERSION} \ tint2 && \ echo "**** openbox tweaks ****" && \ sed -i \ 's/NLMC/NLIMC/g' \ /etc/xdg/openbox/rc.xml && \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ rm -rf \ /tmp/* #add local files COPY /root / # ports and volumes EXPOSE 3000 VOLUME /config auto-start

By default, desktop applications start only when users log in to the Web interface. If you want to run the application when the container starts, you need to set the environment variable:

-e GUIAUTOSTART=true

If the user changes the password in the default container to abc, you also need to set password options to ensure that the application starts automatically:

-e PASSWORD=yourpassword The above is how to run Linux desktop with docker shared by Xiaobian. If you happen to have similar doubts, please refer to the above analysis for understanding. If you want to know more about it, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report