Friday, January 28, 2011

Installing flash on CentOS

   Simple solution:

http://www.yqed.com/install-flash-player-10-centos-64-bits/

1. Start by installing those libraries (.i386 and .x86_64):
# yum install curl compat-libstdc++-33 glibc nspluginwrapper
2. Once done with the kitchen work, it is time to install the Flash Player RPM.
# rpm -ivh /tmp/flash-plugin-10.0.12.36-release.i386.rpm
3. Close all Firefox windows and open a new one. In the address bar, type:
about:plugins

 There you go.  Thats it.  Have fun playing kitten cannon.

Starting "Screen Sharing" vnc connection from the command line (Mac OS X)

   Big shout out to Bob237 for the answer to this question.

   I wanted to make it easy to start a vnc session with the new Xen machines I had created.  However, I was having a problem that when I invoked:

open vnc://1.2.3.4:5901 

and entered my password the Screen Sharing window would go white.

   Apparently if you want to start a Screen Sharing session from the command line (Mac OS X) you must first open 'Finder' and browse to /Applications (or /System/Library/CoreServices), right click on Screen Sharing.app and check the box that says "Open in 32-bit mode".

   That's it.  The next time you run the the open vnc command you should have no problems.

Link:
http://discussions.apple.com/thread.jspa?threadID=2414203&tstart=135

Wednesday, January 26, 2011

Xen: Unable to allocate memory

   So it was rather frustrating that after I got all of the domUs created and ready when I rebooted the machine it decided to not start 3 doms.  After talking with a colleague I was directed to the following page:

http://wiki.xensource.com/xenwiki/XenBestPractices

   In the above link it says to modify '/boot/grub/menu.lst' and add the following:

dom0_mem=512M loglvl=all guest_loglvl=all

   then you are to edit '/etc/xen/xend-config.sxp' and modify/add the follwoing:

(dom0-min-mem 512)
(enable-dom0-ballooning no)

   After setting these options you need to restart the machine and all of the domUs (5+) should start without any errors of "allocating memory"

Monday, January 24, 2011

Setting up Debian with VNC

For this example I am using tightvncserver:

1. Install tightvncserver
sudo aptitude install tightvncserver
2. Start a vnc session:
>$ vncserver :1
   b. Try to connect to the server
      i. using screen share type in 10.1.10.10:590?
      ii. Enter your password
3. Stop the server:
   a. >$ vncserver -kill :1
4. Edit the config file in ~/.vnc/xstartup to have it look like the following:
>$ vim ~/.vnc/xstartup

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
gnome-session &
# Fix to make GNOME work
#export XKL_XMODMAP_DISABLE=1
#/etc/X11/Xsession

5. Edit vncserver and make the following change:
>$ sudo vim /etc/alternatives/vncserver

44 #$geometry = "1024x768";
45 $geometry = "1344x840";
46 $depth = 24;
6. Create/Edit the following file:
>$ sudo vim /etc/init.d/vncserver

#! /bin/sh -e
### BEGIN INIT INFO
# Provides:     vncserver
# Required-Start:   $local_fs
# Required-Stop:    
# Should-Start:     vncserver
# Should-Stop:      vncserver
# Default-Start:    2 3 4 5
# Default-Stop:     0 1 6
# Short-Description:    Start vncserver.
### END INIT INFO

# Some things that run always
touch /var/lock/vncserver

# Carry out specific functions when asked to by the system
case "$1" in
start)
echo "Starting script vncserver "
su - test -c "vncserver :1"
;;
stop)
echo "Stopping script vncserver"
su - test -c "vncserver -kill :1"
;;
*)
echo "Usage: /etc/init.d/vncserver {start|stop}"
exit 1
;;
esac

exit 0
   a. Change "test" to your username
7. Change the permissions:
>$ sudo chmod 755 /etc/init.d/vncserver
8. Set the script to start at boot:
>$ sudo update-rc.d vncserver defaults

"Failed to find an unused loop device"

So after spending an entire day trying to install a domU from a bad ISO I finally had one running which I decided to make clones of. After making 7 additional clones I tried to start them all at the same time but received the error of "Failed to find an unused loop device."

After looking around I found the following site:

http://snippets.aktagon.com/snippets/70-Fix-for-Failed-to-find-an-unused-loop-device-when-using-xen

Here it explains that the Xen machine is not setup to handle this many loop devices by default. By default each domU may take at least two loop devices. The solution to the problem was to create the file '/etc/modprobe.d/local-loop' and place the following line in it:

options loop max_loop=64

After creating this file and restarting the machine I am able to create at least 7 domUs and have them running at the same time.

Wednesday, January 5, 2011

sudo and cat

Have you ever wanted to cat something and redirect it to another file but received the error or "Permission denied?" Apparently it is due to the fact that sudo is only applied to the first part of the redirection and not the the file you want to redirect it to.

For example:

$ sudo cat /etc/passwd > /etc/passwd1
-bash: /etc/passwd1: Permission denied

I have found a forum post that gives an explanation and a fix:

http://www.linuxquestions.org/questions/linux-software-2/sudo-and-permission-denied-651619/#post3194983

posts #2 and #3