Citrix Receiver Ubuntu Certificate

I installed the Citrix receiver (receiver.citrix.com) .deb file successfully on my newly installed 12.04.2LTS x64 laptop. Unfortunately the POC for citrix had a self-signed certificate.

I was receiving Error 61 that the certificate was untrusted and I had to quit the application.

Ended up copying the root certificate over to /usr/local/share/ca-certificates, changing the name, and running the cert update. This did not fix my issue, but it’s good to know anyway:

SSH as root, or add sudo before all commands
cp YOURCERTFILE.cer /usr/local/share/ca-certificates/
cd /usr/local/share/ca-certificates
mv YOURCERTFILE.cer YOURCERTFILE.crt
update-ca-certificates

Since that did not work, now I went on looking for the certificate store on the Citrix side:
cp YOURCERTFILE.crt /opt/Citrix/ICAClient/keystore/cacerts/

Try your xendesktop or xenapp now. Magic bananas.

Citrix XenServer Stuck VM

I had a virtual machine that was stuck trying to reboot. I attempted to force it to reboot via XenCenter, but it wasn’t working. Stuck with the yellow symbol.

Found the following commands:

All command line, so get used to SSH as root
Generally you should SSH to your primary server, but the commands below seemed to work ok on the secondaries (unless otherwise noted)

Get the UUID for your VM
xe vm-list
or
xe vm-list name-label=YOURVMGUESTNAME
Or grab the UUID from XenCenter

In my case it’s:
1dd7cc44-0dce-2149-4a9f-27425ee8eae0

Force the VM to shutdown:
xe vm-shutdown uuid=1dd7cc44-0dce-2149-4a9f-27425ee8eae0 force=true

If that fails, try this:
xe vm-reset-powerstate uuid=1dd7cc44-0dce-2149-4a9f-27425ee8eae0 force=true

I also tried to reset the toolstack on the PRIMARY XENSERVER
xe -toolstack-restart
Good to know that command, but it did nothing for me.

If that fails you may need to kill the domain (similar to removing the power from the VM):
list_domains | grep YOURUUID
The number in the front is the domain ID

Kill the Domain ID
/opt/xensource/debug/xenops destroy_domain -domid YOURDOMAINID

Extend LUN iSCSI Citrix XenServer

I have a pair of xenservers connected via 10Gb Ethernet to a pair of Equalogics SAN devices (iscsi). Needed to expand or increase the size of the LUN that our VDI environment was connected through while maintaining the uptime of the VDI environment. I first extended the available space on the SAN side, so this document is only for the Citrix/XenServer configuration.

Connect to your XenServer
SSH to your master server (or primary if you only have one) as root
You can either list all of your available storage or, if you know what type, you can list only iscsi. In my case I’d list the iscsi, but both commands are listed below.

List all storage
xe sr-list

List only iscsi storage
xe sr-list type=lvmoiscsi

List only the SR you want
xe sr-list name-label=YOURSR

From here we’ll see something like:

uuid ( RO) : 6f16bb1c-1a3d-b9d3-98d4-7b57b30934c0
name-label ( RW): EXT_VDI
name-description ( RW): iSCSI SR [10.10.10.10 (iqn.2001-05.com.equallogic:0-1db196-0d76a8743-a05b26ff2g651be5-extvdi; LUN 0: 6019DA3174A8760DE51A652DEE265BA0: 1500 GB (EQLOGIC))]
host ( RO):
type ( RO): lvmoiscsi
content-type ( RO):

We want the UUID from this step – and notice the size (1500 GB). I wanted to make this 2500GB instead.

Now we need to find the device location for this LVM
pvscan | grep THEUUIDFROMABOVE
pvscan | grep 6f16bb1c-1a3d-b9d3-98d4-7b57b30934c0

PV /dev/sdj VG VG_XenStorage-6f16bb1c-1a3d-b9d3-98d4-7b57b30934c0 lvm2 [1.50 TB / 688.85 GB free]

Rescan the device – change “sdj” to your dev device name from the last step
echo 1 > /sys/block/sdj/device/rescan

Next we resize the device
pvresize /dev/sdj

And one last rescan
xe sr-scan uuid=THEUUIDOFYOURDEVICE

Raspberry Pi Disable Screensaver

Had a raspberry pi setup as a terminal to display statistics on a television – needed it to not go into sleep mode etc.

SSH or login to your RPi as root
I added the following script

# needs apt-get install x11-xserver-utils first
# if something errors, stop the script
set -e

# set the screensaver to off, no power savings, and no blank screen
xset s off
xset -dpms
xset s noblank

# exec the session manager so you have a toolbar still
exec /etc/alternatives/x-session-manager

I then added a path to rc.local
chmod +x YOURSCRIPTNAME.SH
chmod 777 YOURSCRIPTNAME.SH

nano /etc/rc.local
Add “/path/to/your/script.sh”

***EDIT***
Apparently that does not work – you end up getting a “cannot change display “”” type of argument.

So, change the LXDE autostart function script:
nano /etc/xdg/lxsession/LXDE/autostart

xset s off
xset -dpms
xset s noblank
reboot.