diff --git a/dockerfile-kasm-core b/dockerfile-kasm-core index c0c70d3..fc1db77 100644 --- a/dockerfile-kasm-core +++ b/dockerfile-kasm-core @@ -40,7 +40,8 @@ ENV DISPLAY=:1 \ LANG=$LANG \ LANGUAGE=$LANGUAGE \ LC_ALL=$LC_ALL \ - KASMVNC_AUTO_RECOVER=true + KASMVNC_AUTO_RECOVER=true \ + PULSE_RUNTIME_PATH=/var/run/pulse EXPOSE $VNC_PORT \ $NO_VNC_PORT \ @@ -147,7 +148,8 @@ RUN touch $STARTUPDIR/wm.log \ && rm -rf $STARTUPDIR/install \ && mkdir -p $STARTUPDIR/kasmrx/Downloads \ && chown 1000:1000 $STARTUPDIR/kasmrx/Downloads \ - && chown -R root:root /usr/local/bin + && chown -R root:root /usr/local/bin \ + && chown 1000:root /var/run/pulse USER 1000 diff --git a/dockerfile-kasm-core-centos b/dockerfile-kasm-core-centos index 03dea34..59a5a1c 100644 --- a/dockerfile-kasm-core-centos +++ b/dockerfile-kasm-core-centos @@ -55,7 +55,8 @@ ENV DISPLAY=:1 \ LANGUAGE=$LANGUAGE \ LC_ALL=$LC_ALL \ SINGLE_APPLICATION=0 \ - KASMVNC_AUTO_RECOVER=true + KASMVNC_AUTO_RECOVER=true \ + PULSE_RUNTIME_PATH=/var/run/pulse EXPOSE $VNC_PORT \ $NO_VNC_PORT \ @@ -159,7 +160,8 @@ RUN touch $STARTUPDIR/wm.log \ && rm -rf $STARTUPDIR/install \ && mkdir -p $STARTUPDIR/kasmrx/Downloads \ && chown 1000:1000 $STARTUPDIR/kasmrx/Downloads \ - && chown -R root:root /usr/local/bin + && chown -R root:root /usr/local/bin \ + && chown 1000:root /var/run/pulse USER 1000 diff --git a/dockerfile-kasm-core-nvidia b/dockerfile-kasm-core-nvidia index 5332a68..05774e1 100644 --- a/dockerfile-kasm-core-nvidia +++ b/dockerfile-kasm-core-nvidia @@ -52,7 +52,8 @@ ENV DISPLAY=:1 \ LANG=$LANG \ LANGUAGE=$LANGUAGE \ LC_ALL=$LC_ALL \ - KASMVNC_AUTO_RECOVER=true + KASMVNC_AUTO_RECOVER=true \ + PULSE_RUNTIME_PATH=/var/run/pulse EXPOSE $VNC_PORT \ $NO_VNC_PORT \ @@ -166,7 +167,8 @@ RUN touch $STARTUPDIR/wm.log \ && rm -rf $STARTUPDIR/install \ && mkdir -p $STARTUPDIR/kasmrx/Downloads \ && chown 1000:1000 $STARTUPDIR/kasmrx/Downloads \ - && chown -R root:root /usr/local/bin + && chown -R root:root /usr/local/bin \ + && chown 1000:root /var/run/pulse USER ubuntu diff --git a/dockerfile-kasm-core-oracle b/dockerfile-kasm-core-oracle index f75af8f..7d6a75e 100644 --- a/dockerfile-kasm-core-oracle +++ b/dockerfile-kasm-core-oracle @@ -64,7 +64,8 @@ ENV DISPLAY=:1 \ LANGUAGE=$LANGUAGE \ LC_ALL=$LC_ALL \ SINGLE_APPLICATION=0 \ - KASMVNC_AUTO_RECOVER=true + KASMVNC_AUTO_RECOVER=true \ + PULSE_RUNTIME_PATH=/var/run/pulse EXPOSE $VNC_PORT \ $NO_VNC_PORT \ @@ -172,7 +173,8 @@ RUN touch $STARTUPDIR/wm.log \ && rm -rf $STARTUPDIR/install \ && mkdir -p $STARTUPDIR/kasmrx/Downloads \ && chown 1000:1000 $STARTUPDIR/kasmrx/Downloads \ - && chown -R root:root /usr/local/bin + && chown -R root:root /usr/local/bin \ + && chown 1000:root /var/run/pulse USER 1000 diff --git a/dockerfile-kasm-core-suse b/dockerfile-kasm-core-suse index 0b6d99e..db9595d 100644 --- a/dockerfile-kasm-core-suse +++ b/dockerfile-kasm-core-suse @@ -59,7 +59,8 @@ ENV DISPLAY=:1 \ LANGUAGE=$LANGUAGE \ LC_ALL=$LC_ALL \ SINGLE_APPLICATION=0 \ - KASMVNC_AUTO_RECOVER=true + KASMVNC_AUTO_RECOVER=true \ + PULSE_RUNTIME_PATH=/var/run/pulse EXPOSE $VNC_PORT \ $NO_VNC_PORT \ @@ -156,7 +157,8 @@ RUN touch $STARTUPDIR/wm.log \ && rm -rf $STARTUPDIR/install \ && mkdir -p $STARTUPDIR/kasmrx/Downloads \ && chown 1000:1000 $STARTUPDIR/kasmrx/Downloads \ - && chown -R root:root /usr/local/bin + && chown -R root:root /usr/local/bin \ + && chown 1000:root /var/run/pulse USER 1000 diff --git a/src/common/startup_scripts/vnc_startup.sh b/src/common/startup_scripts/vnc_startup.sh index 08c6b9a..b8025b3 100644 --- a/src/common/startup_scripts/vnc_startup.sh +++ b/src/common/startup_scripts/vnc_startup.sh @@ -110,16 +110,16 @@ function start_audio_out (){ if [ "${START_PULSEAUDIO:-0}" == "1" ] ; then echo "Starting Pulse" - pulseaudio --start + HOME=/var/run/pulse pulseaudio --start fi if [[ $DEBUG == true ]]; then echo 'Starting audio service in debug mode' - no_proxy=127.0.0.1 ffmpeg -f pulse -fragment_size ${PULSEAUDIO_FRAGMENT_SIZE:-2000} -ar 44100 -i default -f mpegts -correct_ts_overflow 0 -codec:a mp2 -b:a 128k -ac 1 -muxdelay 0.001 http://127.0.0.1:8081/kasmaudio & + HOME=/var/run/pulse no_proxy=127.0.0.1 ffmpeg -f pulse -fragment_size ${PULSEAUDIO_FRAGMENT_SIZE:-2000} -ar 44100 -i default -f mpegts -correct_ts_overflow 0 -codec:a mp2 -b:a 128k -ac 1 -muxdelay 0.001 http://127.0.0.1:8081/kasmaudio & KASM_PROCS['kasm_audio_out']=$! else echo 'Starting audio service' - no_proxy=127.0.0.1 ffmpeg -v verbose -f pulse -fragment_size ${PULSEAUDIO_FRAGMENT_SIZE:-2000} -ar 44100 -i default -f mpegts -correct_ts_overflow 0 -codec:a mp2 -b:a 128k -ac 1 -muxdelay 0.001 http://127.0.0.1:8081/kasmaudio > /dev/null 2>&1 & + HOME=/var/run/pulse no_proxy=127.0.0.1 ffmpeg -v verbose -f pulse -fragment_size ${PULSEAUDIO_FRAGMENT_SIZE:-2000} -ar 44100 -i default -f mpegts -correct_ts_overflow 0 -codec:a mp2 -b:a 128k -ac 1 -muxdelay 0.001 http://127.0.0.1:8081/kasmaudio > /dev/null 2>&1 & KASM_PROCS['kasm_audio_out']=$! echo -e "\n------------------ Started Audio Out ----------------------------" echo "Kasm Audio Out PID: ${KASM_PROCS['kasm_audio_out']}"; diff --git a/src/ubuntu/install/audio/install_audio.sh b/src/ubuntu/install/audio/install_audio.sh index 848d6a4..8bac287 100644 --- a/src/ubuntu/install/audio/install_audio.sh +++ b/src/ubuntu/install/audio/install_audio.sh @@ -28,6 +28,8 @@ else apt-get install -y curl git ffmpeg fi +mkdir -p /var/run/pulse + cd $STARTUPDIR mkdir jsmpeg wget -qO- https://kasmweb-build-artifacts.s3.amazonaws.com/kasm_websocket_relay/f173f72a9faa6239e43f2efcb48aabe8a984d443/kasm_websocket_relay_${DISTRO/kali/ubuntu}_${ARCH}_develop.f173f7.tar.gz | tar xz --strip 1 -C $STARTUPDIR/jsmpeg