Instantly share code, notes, and snippets.

Embed
What would you like to do?
Guacinstall
## GUAC INSTALL
yum update
yum install docker
systemctl start docker.service
docker run --name docker-postgres -v /some/path/on/host:/var/lib/postgresql/data -e POSTGRES_PASSWORD=PASSWORD_HERE -d postgres
docker run --rm glyptodon/guacamole /opt/guacamole/bin/initdb.sh --postgres > initdb.sql
docker run -it --link docker-postgres:postgres --rm postgres sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres'
# Enter your postgresql password from line 5
CREATE DATABASE guacamole_db;
\q
cat initdb.sql | docker run -i --link docker-postgres:postgres --rm postgres sh -c 'export PGPASSWORD="PASSWORD_HERE"; exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres -d guacamole_db'
docker run --name docker-guacd -d glyptodon/guacd
docker run --name docker-guacamole --link docker-guacd:guacd \
--link docker-postgres:postgres \
-e POSTGRES_DATABASE=guacamole_db \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=PASSWORD_HERE \
-d -p 8080:8080 glyptodon/guacamole
# Browse to http://IP.of.docker.host:8080/guacamole
# Login with guacadmin:guacadmin
# CHANGE THE guacadmin PASSWORD!
## CONNECTION ADD
docker run -it --link docker-postgres:postgres --rm postgres sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres'
\c guacamole_db
#-- Create connection
INSERT INTO guacamole_connection (connection_name, protocol) VALUES ('test', 'vnc');
#-- Determine the connection_id
SELECT * FROM guacamole_connection WHERE connection_name = 'test' AND parent_id IS NULL;
This will be CONNECTION_ID (should be 1 for your first connection)
#-- Add parameters to the new connection
INSERT INTO guacamole_connection_parameter VALUES (CONNECTION_ID, 'hostname', 'IP.OF.VNC.SERVER');
INSERT INTO guacamole_connection_parameter VALUES (CONNECTION_ID, 'port', '5900');
INSERT INTO guacamole_connection_parameter VALUES (CONNECTION_ID, 'password', 'VNC_PASSWORD_IF_ANY');
\q
## ESXi VNC ENABLE
ssh user@ip.of.esxi.host
# VM must be powered off!
echo -e "RemoteDisplay.vnc.enabled = true\nRemoteDisplay.vnc.port = 5900\nRemoteDisplay.vnc.password = \"VNC_PASSWORD\"" >> /vmfs/volumes/YOURDATASTORE/YOURVMNAME/YOURVMNAME.vmx
cp /etc/vmware/firewall/service.xml /etc/vmware/firewall/service.xml.bak
chmod 644 /etc/vmware/firewall/service.xml
chmod +t /etc/vmware/firewall/service.xml
vi /etc/vmware/firewall/service.xml
# ADD (be sure to set the correct service id!)
<!-- FOR VNC -->
<service id="00XX">
<id>VNC In</id>
<rule id='0000'>
<direction>inbound</direction>
<protocol>tcp</protocol>
<porttype>dst</porttype>
<port>5900</port>
</rule>
<enabled>true</enabled>
<required>false</required>
</service>
chmod 444 /etc/vmware/firewall/service.xml
esxcli network firewall refresh
esxcli network firewall ruleset list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment