Project

General

Profile

The ungleich VNC console » History » Version 3

Jin-Guk Kwon, 01/30/2020 07:49 PM

1 1 Jin-Guk Kwon
h1. The ungleich VNC console
2
3 2 Jin-Guk Kwon
{{toc}}
4
5 1 Jin-Guk Kwon
h2. 1. System Architecture
6
7
!archi.png!
8
9 2 Jin-Guk Kwon
h2. 2. Set guacamole server
10 1 Jin-Guk Kwon
11
- run cdist
12
13
<pre>
14
cd ~/.cdist; git pull; cdist config -bj7 -p9 -vv desktop.ungleich.ch
15
</pre>
16
17
- in manifest 
18
19
<pre>
20
……
21
desktop.ungleich.ch)
22 3 Jin-Guk Kwon
        __guacamole_centos  --ldap-hostname 'ldap server url' \
23 1 Jin-Guk Kwon
          --ldap-port '636' \
24
          --ldap-encryption-method 'ssl' \
25 3 Jin-Guk Kwon
          --ldap-user-base-dn 'ou=XXX,dc=ungleich,dc=ch' \
26 1 Jin-Guk Kwon
          --ldap-search-bind-password ‘refer to pass' \
27 3 Jin-Guk Kwon
          --ldap-search-bind-dn 'cn=XXXXX,dc=ungleich,dc=ch' \
28 1 Jin-Guk Kwon
          --ldap-username-attribute 'uid' \
29
          --postgresql-hostname 'localhost' \
30 3 Jin-Guk Kwon
          --postgresql-username 'USER name' \
31
          --postgresql-database 'DB-name' \
32
          --postgresql-port     'XXXX' \
33
          --postgresql-password 'password' \
34 1 Jin-Guk Kwon
          --TOTP \
35
          --guacd-db 'postgresql'
36
</pre>
37
38 2 Jin-Guk Kwon
h2. 3. Create VNC connection for VM 
39 1 Jin-Guk Kwon
40
!g_con.png!
41
42
h3. 1) install postgresql on opennebual server
43
44
<pre>
45
apt install postgresql-client
46
</pre>
47
48 2 Jin-Guk Kwon
h3. 2) config postgresql for accessing from external host
49 1 Jin-Guk Kwon
50 2 Jin-Guk Kwon
- vi /var/lib/pgsql/data/postgresql.conf on guacamole server(desktop)
51 1 Jin-Guk Kwon
52
<pre>
53
listen_addresses = '*'
54
</pre>
55
56 2 Jin-Guk Kwon
- vi /var/lib/pgsql/data/pg_hba.conf on guacamole server(desktop)
57 1 Jin-Guk Kwon
58
<pre>
59
host    all         all            opennbula server address trust
60
</pre>
61
62 2 Jin-Guk Kwon
- Restart postgresql
63
64 1 Jin-Guk Kwon
<pre>
65
systemctl restart postgresql
66
</pre>
67
68 2 Jin-Guk Kwon
h3. 3) set vnc connection automatically on opennebula server 
69 1 Jin-Guk Kwon
70 2 Jin-Guk Kwon
h4. (1) vnc connection script
71 1 Jin-Guk Kwon
72 2 Jin-Guk Kwon
- vm_list_dual_uid : create VM list file(uid, email, VM Number, host, VNC port) (https://code.ungleich.ch/ungleich-public/ungleich-tools/blob/master/vm_list_dual_uid)
73 1 Jin-Guk Kwon
74 2 Jin-Guk Kwon
- create-guacamole-session-ldap-db : create VNC connection on desktop (https://code.ungleich.ch/ungleich-public/ungleich-tools/blob/master/create-guacamole-session-ldap-DB)
75 1 Jin-Guk Kwon
76 2 Jin-Guk Kwon
h4. (2) create crontab
77 1 Jin-Guk Kwon
78
<pre>
79
crontab -e
80
</pre>
81
82
<pre>
83
15 0,2,4,6,8,10,12,14,16,18,20,22 * * * ./vm_list_dual_uid #create vm_list
84
45 0,2,4,6,8,10,12,14,16,18,20,22 * * * ./create-guacamole-session-ldap-db vm_vnc_list #create vm_list
85
</pre>
86 2 Jin-Guk Kwon
87
h2. ※User VM information is synchronized with the VNC console every hour. If you create VM right now, you can access VNC console after one hour.(vnc connection script takes about 7~8 minutes.)