Archive

Archive for the ‘Ubuntu’ Category

Switch between log in managers

January 31, 2012 Leave a comment

There are a couple of log in managers in Ubuntu, such as gdm, lightdm. kde.

Switching between these log in managers is easy:

$ sudo dpkg-reconfigure gdm

And then select a log in manager in the popup window.

Categories: gnome, Ubuntu

Install tightVNC on Ubuntu server

January 29, 2012 Leave a comment

1. Make sure Ubuntu desktop is ready

2. Install tightvnc server

$ sudo apt-get install tightvncserver

3. Test vnc client

Launch tightvnc or ultravnc viewer, and input server as “192.168.1.101:1”

4. Start up applications with vnc client log in

Put all application start up commands in ~/.vnc/xstartup.

5. Create a booting script

$ sudo vi /etc/init.d/vncserver

———————– vncserver begin —————————

#!/bin/sh -e
### BEGIN INIT INFO
# Provides:          vncserver
# Required-Start:    networking
# Default-Start:     3 4 5
# Default-Stop:      0 6
### END INIT INFO
PATH=”$PATH:/usr/X11R6/bin/”# The Username:Group that will run VNC
export USER=”vncuser”           # The user to start vnc
#${RUNAS}# The display that VNC will use
DISPLAY=”1″    # user display number 1

# Color depth (between 8 and 32)
DEPTH=”16″

# The Desktop geometry to use.
#GEOMETRY=”<WIDTH>x<HEIGHT>”
#GEOMETRY=”800×600″
GEOMETRY=”1024×768″
#GEOMETRY=”1280×1024″

# The name that the VNC Desktop will have.
NAME=”vnc-server”

OPTIONS=”-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}”

. /lib/lsb/init-functions

case “$1” in
start)
log_action_begin_msg “Starting vncserver for user ‘${USER}’ on localhost:${DISPLAY}”
su ${USER} -c “/usr/bin/vncserver ${OPTIONS}”
;;

stop)
log_action_begin_msg “Stoping vncserver for user ‘${USER}’ on localhost:${DISPLAY}”
su ${USER} -c “/usr/bin/vncserver -kill :${DISPLAY}”
;;

restart)
$0 stop
$0 start
;;
esac

exit 0

———————– vncserver end ———————

6. Change the script to excutable

$ sudo chmod +x vncserver

7. Set up vncserver auto start and stop with system start up and shutdown

$ sudo update-rc.d vncserver defaults     # change the “defaults” to ” defaults 99″ if want it run or stop as the last script

eg.

$ sudo update-rc.d vncserver -f remove

$ sudo update-rc.d vncserver defaults 99

Categories: Ubuntu

Install VNC on Ubuntu server

January 29, 2012 Leave a comment

In order to remote log in via the graphic desk to Ubuntu server, a installation of VNC is needed. Following demonstrate  the detailed steps for VNC setting on Unbuntu.

1. Make sure Gnome or other x-window is ready on Ubuntu

2. Install VNC server on Ubuntu

$ sudo apt-get install vnc4server

3. Set up a VNC password for current user, this password is needed while connect VNC client

$ vncpasswd

4. Set up a display number

$ vncserver :1

This would create necessary files for VNC server.

VNC clinet log in need to input “192.168.1.100:1”. The number “1” is the display number.

5. Set up Gnome for VNC log in

5.1 Shutdown VNC server

$ vncserver -kill :1

5.2 Set up xstartup file for current user

$ cd

$ cd .vnc

$ vi xstartup

——- xstartup ———

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
# x-terminal-emulator -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &               # comment this line
# x-window-manager &                  # comment this line
gnome-session &                        # add this line, for gnome only

———————- xstartup ——————

5.3 Restart vncserver

$ vncserver :1

6. vnc client log in error

Failed to load session “Ubuntu”

This message is because the problem of desktop installation. Use “apt-get install ubuntu-desktop” to reinstall the graphic desktop.

Categories: Ubuntu

Set password for root in Ubuntu

January 28, 2012 Leave a comment

Password for root is not set by default, so the command “su -” would not work.

3 approaches to work as root:

1. sudo -i

2. sudo bash

3. sudo -s

Then change the root password:

passwd

OR directly change root password as:

$ sudo passwd root

Disable root:

$ sudo -dl root

 

Categories: root password

Install Gnome on ubuntu server

January 27, 2012 Leave a comment

1. Auto install

sudo aptitude install ubuntu-desktop

OR

sudo apt-get install ubuntu-desktop

This would install Ubuntu Unity graphic desktop.

 

2. Manual install

2.1 Install x-windows core

sudo apt-get install x-window-system-core

2.2 Install gnome core

sudo apt-get install gnome-core

2.3 Install gdm (option)

sudo apt-get install gdm

2.4 Install synaptic (option)

sudo apt-get install synaptic

2.5 Remove gnome

sudo apt-get –purge remove liborbit2

2.6 Start gnome

startx

2.7 Exit gnome

ctrl + alt + backspace

sudo apt-get install synaptic

2.8 Note

If the server is on Vmware virtual server, the vmware-tools is needed; and gcc compiler is needed for vmeare-tools installation.

Categories: gnome, Ubuntu