본문 바로가기
Virtual

Ubuntu에 VNC 설치

by Yoon_estar 2024. 4. 1.
728x90
반응형
OS : Ubuntu : 20.04.4

turbovnc_2.2.6_amd64.deb

해당 파일로 설치하였다.
# dpkg -i turbovnc_2.2.6_amd64.deb
# dpkg -L "turbovnc" | grep bin (경로 찾기)
# cd /opt/TurboVNC/bin/
# /opt/TurboVNC/bin/vncviewer (실행)

발생한 오류

# /opt/TurboVNC/bin/vncviewer
WARNING: Could not find libjawt.so. Some features may not work properly.
/opt/TurboVNC/bin/vncviewer: 65: exec: java: not found

해결

아래 블로그를 참고하여 java를 설치하였다.

https://github.com/jitsi/jitsi/issues/400

 

jitsi fails to find libjawt.so on ubuntu linux using the provided packages · Issue #400 · jitsi/jitsi

Launching jitsi on debian/ubuntu results in an error being reported on stderr: 2017-09-12 10:05:47.066 SEVERE: [21] org.jitsi.impl.neomedia.device.DeviceConfiguration.log() Failed to register custo...

github.com

# apt install openjdk-11-jre-headless

!! 원격 터미널에서 실행하여서 아래와 같이 나옴

# /opt/TurboVNC/bin/vncviewer
libjawt.so path: /usr/lib/jvm/java-11-openjdk-amd64/lib
main: Could not set look & feel:
main:   java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.        
main: Could not set insets:
main:   java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.        
java.awt.HeadlessException: 
No X11 DISPLAY variable was set, but this program performed an operation which requires it.        
        at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:208)   
        at java.desktop/java.awt.Window.<init>(Window.java:548)
        at java.desktop/java.awt.Frame.<init>(Frame.java:423)
        at java.desktop/java.awt.Frame.<init>(Frame.java:388)
        at java.desktop/javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1919)
        at java.desktop/javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1995)   
        at java.desktop/javax.swing.JDialog.<init>(JDialog.java:273)
        at java.desktop/javax.swing.JDialog.<init>(JDialog.java:207)
        at com.turbovnc.vncviewer.Dialog.showDialog(Dialog.java:59)
        at com.turbovnc.vncviewer.Dialog.showDialog(Dialog.java:100)
        at com.turbovnc.vncviewer.CConn.<init>(CConn.java:131)
        at com.turbovnc.vncviewer.VncViewer.run(VncViewer.java:803)
        at java.base/java.lang.Thread.run(Thread.java:829)
Exception in thread "Thread-1" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.        
        at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:208)   
        at java.desktop/java.awt.Window.<init>(Window.java:548)
        at java.desktop/java.awt.Frame.<init>(Frame.java:423)
        at java.desktop/java.awt.Frame.<init>(Frame.java:388)
        at java.desktop/javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1919)
        at java.desktop/javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1995)   
        at java.desktop/javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1689)
        at java.desktop/javax.swing.JOptionPane.getWindowForComponent(JOptionPane.java:1630)       
        at java.desktop/javax.swing.JOptionPane.createDialog(JOptionPane.java:961)
        at java.desktop/javax.swing.JOptionPane.createDialog(JOptionPane.java:923)
        at com.turbovnc.vncviewer.VncViewer.reportException(VncViewer.java:616)
        at com.turbovnc.vncviewer.VncViewer.run(VncViewer.java:855)
        at java.base/java.lang.Thread.run(Thread.java:829)

 

가상 머신에서 직접 명령어 실행

외부망 통신이 안 될 경우

아래는 VNC 설치할 때 필요한 java jdk 파일이다. 외부 망이 연결이 되지 않을 경우에는 아래의 파일들을 따로 OS 파일에서 받아서 설치해야한다.

방법

  1. 고객사 외부 통신이 되는 자리에 가서 파일들 다운로드하고 담당자한테 서버에 올려달라고 부탁하기
  2. 회사에서 yum 혹은 apt 로 받은 후 deb 파일로 만들어서 메일로 보내두기
Start-Date: 2024-04-01  14:03:27
Commandline: apt install default-jre
Install: ca-certificates-java:amd64 (20190405ubuntu1.1, automatic), default-jre-headless:amd64 (2:1.11-72, automatic), default-jre:amd64 (2:1.11-72), libatk-wrapper-java:amd64 (0.37.1-1, automatic), openjdk-11-jre-headless:amd64 (11.0.22+7-0ubuntu2~20.04.1, automatic), libatk-wrapper-java-jni:amd64 (0.37.1-1, automatic), openjdk-11-jre:amd64 (11.0.22+7-0ubuntu2~20.04.1, automatic), fonts-dejavu-extra:amd64 (2.37-1, automatic), java-common:amd64 (0.72, automatic)
End-Date: 2024-04-01  14:03:40
# /opt/TurboVNC/bin/vncviewer
WARNING: Could not find libjawt.so. Some features may not work properly.
/opt/TurboVNC/bin/vncviewer: 65: exec: java: not found

# apt install --download-only openjdk
# apt install --download-only default-jdk
# cd /var/cache/apt/archives
# mkdir /root/deb
# cp *.deb /root/deb/
# vim /etc/resolv.conf
# dpkg -i *.deb
반응형