Thursday Jun 04, 2009

How to start VNC session on OpenSolaris 2009.06 EC2 AMI

Following instructions describes steps to access GUI on OpenSolaris 2009.06 EC2 AMI Instance using VNC Viewer.

Enable following desktop related services

svcadm enable svc:/application/graphical-login/gdm:default
svcadm enable svc:/application/desktop-cache/icon-cache:default
svcadm enable svc:/application/desktop-cache/desktop-mime-cache:default
svcadm enable svc:/application/desktop-cache/mime-types-cache:default
svcadm enable svc:/application/desktop-cache/input-method-cache:default
svcadm enable svc:/application/desktop-cache/gconf-cache:default
svcadm enable svc:/application/desktop-cache/pixbuf-loaders-installer:default

Set xvm_vnc property to true for x11-server SMF service.

svccfg -s x11-server setprop options/xvm_vnc = boolean: true

Set the root password, you may need it to get back to your session in case if screen saver starts.

root@domU-12-31-39-02-5C-D1:~# passwd
passwd: Changing password for root
New Password:
Re-enter new Password:
passwd: password successfully changed for root
root@domU-12-31-39-02-5C-D1:~#

Setup VNC server

Create .vnc directory under /root if it does not exist
mkdir /root/.vnc/

Create /root/.vnc/xstartup file with following lines.
#!/bin/sh
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
gnome-terminal -geometry 100x60 -title "$VNCDESKTOP Desktop" &
/usr/bin/gnome-session
Note: if xstartup file is already exist, replace it with above lines to start gnome terminal session for VNC.

Provide execute permission on xtartup file.
chmod +x /root/.vnc/xstartup

Start the vncserver and set the password.

root@domU-12-31-39-02-5C-D1:~# vncserver

You will require a password to access your desktops.

Password:
Verify:
xauth: creating new authority file /root/.Xauthority

New 'domU-12-31-39-02-5C-D1:1 (root)' desktop is domU-12-31-39-02-5C-D1:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/domU-12-31-39-02-5C-D1:1.log

root@domU-12-31-39-02-5C-D1:~#

Authorize VNC Port
Here we are done with configuring EC2 instance for GUI Remote Access.
Finally we need to authorize the corresponding VNC port on users machine where VNC client is installed.

divyen-patels-macbook:~ divyen$ ec2-authorize default -p 5801
GROUP default
PERMISSION default ALLOWS tcp 5801 5801 FROM CIDR 0.0.0.0/0
divyen-patels-macbook:~ divyen$


Screen Shots
VNC client connection configuration
Snapshot1:http://blogs.sun.com/divyen/resource/snap_1_ec2_opensolaris_2009_06_vnc.jpg
Use public DNS address associated with EC2 instance as the host name.

VNC client connected to OpenSolaris 2009.06 EC2 Instance.
Snapshot2:http://blogs.sun.com/divyen/resource/snap_2_ec2_opensolaris_2009_06_vnc.jpg

For more details on OpenSolaris AMIs visit http://blogs.sun.com/ec2/

Saturday Jan 17, 2009

Get GUI luxury on OpenSolaris 2008.11 EC2 Instance

The following instructions describes steps to access GUI on OpenSolaris EC2 Instance using VNC Viewer.

[ Step - 1]
First steps is to set xvm_vnc property to true for x11-server SMF service. For security reasons it is set to false.

On the terminal type in "svccfg" to modify the service configurations. More details on svccfg is available here.
To come out of svc prompt type in "quit" and hit enter.

root@domU-12-31-39-03-CC-A5:~# svccfg
svc:> select x11-server
svc:/application/x11/x11-server>
svc:/application/x11/x11-server> setprop options/xvm_vnc = true
svc:/application/x11/x11-server> quit

[ Step - 2]
Create .vnc directory under /root if it does not exist
root@domU-12-31-39-03-CC-A5:~# mkdir /root/.vnc/

Create /root/.vnc/xstartup file with following lines.

#!/bin/sh
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
gnome-terminal -geometry 100x60 -title "$VNCDESKTOP Desktop" &
/usr/bin/gnome-session


Note: if xstartup file is already exist, replace it with above lines to start gnome terminal session for VNC.

Provide execute permission on xtartup file.
root@domU-12-31-39-03-CC-A5:~#chmod +x /root/.vnc/xstartup

[ Step - 3]
Start the vncserver and set the password.

root@domU-12-31-39-03-CC-A5:~# vncserver

You will require a password to access your desktops.

Password:
Verify:
xauth: creating new authority file /root/.Xauthority

New 'domU-12-31-39-03-CC-A5:1 (root)' desktop is domU-12-31-39-03-CC-A5:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/domU-12-31-39-03-CC-A5:1.log

root@domU-12-31-39-03-CC-A5:~#


[ Step - 4 ]
Here we are done with configuring EC2 instance for GUI Remote Access.
Finally we need to authorize and open the listening VNC port on the server with the ec2 group you are using with your instance.

divyen-patels-macbook:~ divyen$ ec2-authorize default -p 5901
GROUP default
PERMISSION default ALLOWS tcp 5901 5901 FROM CIDR 0.0.0.0/0
divyen-patels-macbook:~ divyen$


Screen Shots
VNC client connection configuration
Snapshot1:http://blogs.sun.com/divyen/resource/opensolaris_ec2_vnc_client_img_1.gif
Use public DNS address associated with EC2 instance as the host name.

VNC client connected to OpenSolaris 2008.11 EC2 Instance.
Snapshot2:http://blogs.sun.com/divyen/resource/opensolaris_ec2_vnc_client_img_2.gif

For more details on OpenSolaris AMIs visit http://blogs.sun.com/ec2/
About

Divyen Patel

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today