From b34e0cbb0279e06e04cc7e9b3d1a848864be07e2 Mon Sep 17 00:00:00 2001 From: andrew-ld <43882924+andrew-ld@users.noreply.github.com> Date: Fri, 10 May 2024 10:09:24 +0200 Subject: [PATCH 1/3] fix "shmget: No space left on device" --- cli/src/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/app.py b/cli/src/app.py index 65bde6b1..ced988bf 100644 --- a/cli/src/app.py +++ b/cli/src/app.py @@ -117,7 +117,7 @@ def start_vnc_server() -> None: last_arg = "-nopw" display = os.getenv(ENV.DISPLAY) - args = f"-display {display} -forever -shared {last_arg}" + args = f"-display {display} -forever -shared -noshm {last_arg}" vnc_server = Application("vnc_web", cmd, args, False) vnc_server.start() From 8bdb2d41f9cac2877e317bc03c8dd4a4665a7f8d Mon Sep 17 00:00:00 2001 From: andrew-ld <43882924+andrew-ld@users.noreply.github.com> Date: Tue, 14 May 2024 09:48:01 +0200 Subject: [PATCH 2/3] add VNC_USE_SHM --- cli/src/app.py | 11 ++++++++--- cli/src/constants/ENV.py | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cli/src/app.py b/cli/src/app.py index ced988bf..47e4d15a 100644 --- a/cli/src/app.py +++ b/cli/src/app.py @@ -112,12 +112,17 @@ def start_vnc_server() -> None: if vnc_pass: pass_path = os.path.join(os.getenv(ENV.WORK_PATH), ".vncpass") subprocess.check_call(f"{cmd} -storepasswd {vnc_pass} {pass_path}", shell=True) - last_arg = f"-rfbauth {pass_path}" + pass_arg = f"-rfbauth {pass_path}" else: - last_arg = "-nopw" + pass_arg = "-nopw" + + if convert_str_to_bool(os.getenv(ENV.VNC_USE_SHM, "true")): + shm_arg = "" + else: + shm_arg = "-noshm" display = os.getenv(ENV.DISPLAY) - args = f"-display {display} -forever -shared -noshm {last_arg}" + args = f"-display {display} -forever -shared ${shm_arg} {pass_arg}" vnc_server = Application("vnc_web", cmd, args, False) vnc_server.start() diff --git a/cli/src/constants/ENV.py b/cli/src/constants/ENV.py index 8a8254c0..c1b1a322 100644 --- a/cli/src/constants/ENV.py +++ b/cli/src/constants/ENV.py @@ -10,6 +10,7 @@ SCREEN_WIDTH = "SCREEN_WIDTH" VNC_PASSWORD = "VNC_PASSWORD" VNC_PORT = "VNC_PORT" +VNC_USE_SHM = "VNC_USE_SHM" WEB_VNC_PORT = "WEB_VNC_PORT" WEB_VNC = "WEB_VNC" WORK_PATH = "WORK_PATH" From eed3018fe1c51181ecdde9e95bc2f211c9695ff6 Mon Sep 17 00:00:00 2001 From: andrew-ld <43882924+andrew-ld@users.noreply.github.com> Date: Tue, 14 May 2024 09:49:43 +0200 Subject: [PATCH 3/3] fix --- cli/src/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/app.py b/cli/src/app.py index 47e4d15a..3b438a0e 100644 --- a/cli/src/app.py +++ b/cli/src/app.py @@ -122,7 +122,7 @@ def start_vnc_server() -> None: shm_arg = "-noshm" display = os.getenv(ENV.DISPLAY) - args = f"-display {display} -forever -shared ${shm_arg} {pass_arg}" + args = f"-display {display} -forever -shared {shm_arg} {pass_arg}" vnc_server = Application("vnc_web", cmd, args, False) vnc_server.start()