Setting up VNCServer on Linux CentOS 6.2

CentOS does have a built in VNC server I found called Remote Desktop (not to be confused with Windows Remote Desktop).  I managed to get that turned on and working but the performance of it seemed slow.
I then tried RealVNC but had troubles getting it started at boot.   I found these instructions  and used them to form my set of instructions.

These instructions will help you install VNCServer (TigerVNC), open ports on the firewall and start VNCServer at boot.
A few things about VNCServer on Linux.  It doesn’t work quite the same as on Windows.  You get connected to a new instance of X Windows for each user.
If you log off the user it tends to kill the session and it won’t work again unless vncserver is restarted or you reboot.
This doesn’t connect you to the “console” session, the session that’s present at the keyboard and monitor.
I didn’t take time to figure out the best way to do that.

These instructions assume you know how to edit text files using vi.
If no here is a good cheat sheet:

Install VNCServer as root: yum install vnc-server

Login and create vnc password: vncpasswd (logged in as vnc user not root)

Edit vnc server configuration: vi /etc/sysconfig/vncservers

Remove the # sign from the VNCSERVERS AND VNCSERVERARGS
Add a port for each user you need (2:username means port 2)
Remove -localhost or you won’t be able to connect to the server.
That is for encrypted connections through ssh.
So mine looks like:
VNCSERVERARGS[2]=”-geometry 1280×768″

Start VNC Server manually /sbin/service vncserver start

Add VNC ports to firewall (iptables)

vi /etc/sysconfig/iptables
Add these under the :OUTPUT ACCEPT [0:0]
-A INPUT -m tcp -p tcp –dport 5900 -j ACCEPT
-A INPUT -m tcp -p tcp –dport 5800 -j ACCEPT
-A INPUT -m tcp -p tcp –dport 6000 -j ACCEPT
-A INPUT -m tcp -p tcp –dport 5901 -j ACCEPT
-A INPUT -m tcp -p tcp –dport 5801 -j ACCEPT
-A INPUT -m tcp -p tcp –dport 6001 -j ACCEPT
-A INPUT -m tcp -p tcp –dport 5902 -j ACCEPT
-A INPUT -m tcp -p tcp –dport 5802 -j ACCEPT
-A INPUT -m tcp -p tcp –dport 6002 -j ACCEPT
(Note: you don’t have to put in all of these sets if you only are connecting one user.)
(Also if you only want to allow the connections from one interface and not all you can add  -i eth0 after the second tcp.
This would allow connections to only interface eth0)

Restart iptables: service iptables restart

Test connecting from another VNC client with

Set VNCServer to start at boot: /sbin/chkconfig vncserver on

To see if the vncserver is running: netstat -tulpan | grep vnc

No update sources on Fedora 11 after upgrade from Fedora 10


From Fedora 11 Common Bugs:

When upgrading from an updated F10 install, yum ends up not working – outputting an error about no yum module found.

The version of yum in f10-updates was newer than the one in F11-GA – it caused yum to not be updated during the anaconda upgrade process. There is a simple one-time work around as root:

export PYTHONPATH=/usr/lib/python2.5/site-packages

yum clean all

yum update yum

That should update you to the current yum from F11-updates and you’ll be all set.

Update:  I also had a strange problem with my user account, so I just made a new one then deleted the buggy one.  All is good now.

Add OSX to Fedora Grub triple boot of Windows 7, OSX and Fedora


I managed to get triple booting setup with OSX (iDeneb 10.5.7), Fedora 10 and Windows 7 on my Lenovo T400.

I did it by first installing Windows 7 then OSX next.  After the OSX install I couldn’t boot to Windows 7.
To fix this I booted onto the Windows 7 installation disk and selected repair then command prompt.
At the command prompt run diskpart.  At the diskpart prompt do the following:
list disk
select disk n (n is the disk where Windows is installed)
list partition
select partition n (n is the partition where Windows is installed)

Now Windows 7 should boot, if it doesn’t (and mine didn’t normally) boot onto the Windows 7 install again and select automated recovery of the boot area.
Windows 7 now boots and OSX doesn’t.  Install EasyBCD in Windows, this is used to edit the bootloader.  You can add the OSX in the Add/Remove entries section.
Save and reboot.  Now you should be able to dual boot Windows 7 and OSX.

The next step was to install Fedora 10 (I tried 11 but there was a bug that kept the partitioning tool from installing into the free space on my drive.)
After installing Fedora 10 I was able to dual boot into Windows 7 or Fedora but no OSX using the Grub bootloader.

Next we need to edit the Grub config file that controls what shows up on the menu.  Within Fedora open a terminal and type:
su and hit enter
Put in your root password
Next type:  sudo gedit /boot/grub/menu.lst
This opens the menu.lst file in a text editor.  The first thing I did was change the Windows option from Other to Windows 7 in the title field.
Next I added the following to get OSX into the menu:

title OSX
root (hd0,2)
chainloader +1

Now the root(hd0,2) you have to customize to your setup.  For mine the OSX partition was the 3rd partition on the drive so it ends up as hd0 (the first hard drive),2 (3rd partition starting at 0)

Save and reboot.  You now can triple boot Windows 7, Fedora and OSX.  In theory.
I also changed the default from 0 (Fedora) to 1 (Windows).  This way it automatically goes into Windows (my choice OS) if nothing is selected.

Play DVDs Fedora 10

su –

yum install libdvdread libdvdnav lsdvd

You will only be able to play un-encrypted DVDs with the above installs.  You have to get libdvdcss which has legal issues in the US.

rpm -Uvh
yum install libdvdcss

Remote desktop connection in Linux

I installed a fresh copy of Fedora 10 (which I’m thinking is my favorite Linux distro so far) on my laptop and have been seeing what all I can and can’t do that I normally do on a regular basis.  Right away I wanted to use Remote Desktop to connect to my Windows Server 2008 box.  Well, I coulnd’t find a Remote Desktop client.  I jumped on Google and found mention of RDesktop.  I managed to get that installed and it worked, but I had to launch a terminal prompt and type rdesktop [ServerName].

I poked around some more and found mention of TSClient.  I had gone to the Add/Remove Software tool and searched for remote desktop and rdp and a number of other things, but hadn’t thought to search for TSClient.  It makes sense now that I think about it since remote desktop is also called Terminal Services.

Anyways, to get a GUI based Remote Desktop client search for TSClient and install that.  As a bonus it also installs a VNC viewer as well, which is another tool I use.

Linux commands – mounting Windows shares and configuring sound

Command to mount a Windows share to a folder in Linux:

mount -t cifs //[ServerName]/[SharedFolder] /[MountFolder] -o username=[ServerName]/[Username],password=[Password]

For the mount folder I created a folder under /home/[MyUsername] using MKDir /home/[MyUsername]/Videos

Remove the brackets from Servername etc.  Also make sure there’s no spaces between the = and the username or password.

Troubleshooting Audio problems:

Open Suse has a great audio troubleshooting page found here.

Miscellaneous Linux Commands

Don’t laugh…I’m trying to learn Linux and I just needed a place to store miscellaneous commands, my memory is short and I forget how to do things.

  • ifconfig eth0 (kinda like ipconfig for Windows but does more stuff)
  • fup eth0 (turns on an interface adapter) ifdown does the opposite.
  • hidd –server –search  (Attach bluetooth mouse, make sure you hit the reset button on the mouse so it’s in discover mode.  Found solution here.)
  • yum install libflashsupport  (Install flash support library.  Fixed my issue with no audio from flash files in Firefox.  Found solution here.)