Project

General

Profile

The ungleich VNC console » History » Revision 2

Revision 1 (Jin-Guk Kwon, 01/30/2020 06:46 PM) → Revision 2/13 (Jin-Guk Kwon, 01/30/2020 07:25 PM)

h1. The ungleich VNC console 

 {{toc}} 

 h2. 1. System Architecture 

 !archi.png! 

 h2. 2. Set set guacamole server 

 - run cdist 

 <pre> 
 cd ~/.cdist; git pull; cdist config -bj7 -p9 -vv desktop.ungleich.ch 
 </pre> 

 - in manifest  

 <pre> 
 …… 
 desktop.ungleich.ch) 
         __guacamole_centos    --ldap-hostname 'ldap1.ungleich.ch' \ 
           --ldap-port '636' \ 
           --ldap-encryption-method 'ssl' \ 
           --ldap-user-base-dn 'ou=users,dc=ungleich,dc=ch' \ 
           --ldap-search-bind-password ‘refer to pass' \ 
           --ldap-search-bind-dn 'cn=manager,dc=ungleich,dc=ch' \ 
           --ldap-username-attribute 'uid' \ 
           --postgresql-hostname 'localhost' \ 
           --postgresql-username 'guacamole' \ 
           --postgresql-database 'guacamole' \ 
           --postgresql-port       '5432' \ 
           --postgresql-password 'guacamole' \ 
           --TOTP \ 
           --guacd-db 'postgresql' 
 </pre> 

 h2. 3. Create VNC create connection for VM  

 

 !g_con.png! 

 *- set postgresql client on opennebul server* 

 h3. 1) install postgresql on opennebual server 

 <pre> 
 apt install postgresql-client 
 </pre> 

 h3. 2) config postgresql for accessing from external host 

 - vi /var/lib/pgsql/data/postgresql.conf on guacamole server(desktop) 

 <pre> 
 listen_addresses = '*' 
 </pre> 

 - vi /var/lib/pgsql/data/pg_hba.conf on guacamole server(desktop) 

 <pre> 
 host      all           all              opennbula server address trust 
 </pre> 

 - Restart restart postgresql 

 
 <pre> 
 systemctl restart postgresql 
 </pre> 

 h3. 3) *- set vnc connection automatically on opennebula server server*  

 h4. (1) vnc connection h3. 1) create script 

 - 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) 
 --> get VM info (uid, email, host, port) from ldap and opennebula , it takes about 5~6 minustes now. 
 --> there are only ldap's accounts made by dashboard 

 - 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) 
 --> there is no function of removing user.(The ldap's account remains even if the customer is deleted from the dashboard.) 
 --> It takes about 1~2 minutes. 

 h4. (2) h3. 2) create crontab 

 every hour <-- it need some time to run script 

 <pre> 
 crontab -e 
 </pre> 

 <pre> 
 15 0,2,4,6,8,10,12,14,16,18,20,22 * * * ./vm_list_dual_uid #create vm_list 
 45 0,2,4,6,8,10,12,14,16,18,20,22 * * * ./create-guacamole-session-ldap-db vm_vnc_list #create vm_list 
 </pre> 

 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.)