Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

to get VM by name

$ xec-vm -n "VM Name"

...

Turning on CTRL+0 tip

$ xec set show-msg-on-vm-start true

Making Status Report appear

$ xec status-report-screen true

Poking VM properties

$ xec-vm -n "Windows XP" set-db-key policies.wired-networking true

Writing XenStore

$ xenstore-write /local/domain/1/report/state 1

dbus-send examples

notifications:

$ dbus-send --system --type=signal /host com.citrix.xenclient.xenmgr.host.storage_space_low int32:5 
$ dbus-send --system --type=signal / com.citrix.xenclient.updatemgr.update_state_change string:"downloaded-files"
$ dbus-send --system --type=signal / com.citrix.xenclient.usbdaemon.device_rejected string:"device" string:"reason"
$ dbus-send --system --type=signal / com.citrix.xenclient.xenmgr.guestreq.requested_attention string:<UUID> objpath:<PATH>

generic notifications:

$ dbus-send --system --type=signal / com.citrix.xenclient.xenmgr.host.generic_message string:"Information" string:"Here is some important information"
$ dbus-send --system --type=signal / com.citrix.xenclient.xenmgr.host.generic_message string:"Information" string:"I will only appear for 5 seconds" int32:5000
$ dbus-send --system --type=signal / com.citrix.xenclient.xenmgr.host.generic_message string:"Warning" string:"I am a warning" int32:5000 int16:1
$ dbus-send --system --type=signal / com.citrix.xenclient.xenmgr.host.generic_message string:"Error" string:"I am an error and have a known ID" int32:5000 int16:2 string:"myid2"
$ dbus-send --system --type=signal / com.citrix.xenclient.xenmgr.host.generic_message string:"Information" string:"The percentage I am showing is:" int32:5000 int16:0 string:"myid2" int16:69

signals:

$ dbus-send --system --type=signal / com.citrix.xenclient.xui.popup_network_menu uint32:1000 uint32:72
$ dbus-send --system --type=signal / com.citrix.xenclient.bed.notify.vm.vm_updated_reboot_required string:"<UUID>"
$ dbus-send --system --type=signal / com.citrix.xenclient.bed.notify.vm.vm_updated_clean_reboot_required string:"<UUID>"
$ dbus-send --system --type=signal / com.citrix.xenclient.bed.notify.vm.vm_lease_near_expiry string:"<UUID>" int16:1000
$ dbus-send --system --type=signal /com/citrix/xenclient/xenmgr/host com.citrix.xenclient.bed.notify.server.auth_required

method:

$ dbus-send --system --type=method_call --print-reply --dest=com.citrix.xenclient.xenmgr /com/citrix/xenclient/xenmgr/host com.citrix.xenclient.xenmgr.host.status

Poking the database

$ db-ls
$ db-ls -f
$ db-ls /xenmgr
$ db-rm /xenmgr/showMsgOnVmStart

gettimeofday trickery

$ ps ax (find midori process)
$ strace -p <pid>
$ (strace -p <pid> 2>&1 | grep gettimeofday > file) & sleep 10; kill %1
$ wc -l file

This was to see how often the javascript was polling for gettimeofday, since it affects power.

Debugging UID

$ killall uid
$ LD_PRELOAD=/usr/lib/libv4v-1.0.so.0.0.0 INET_IS_V4V=1 uid --no-daemonize > /tmp/uid.log

Net Boot

Boot a laptop from network, and either pick one of the options as described, or type in the name of a build that's not mentionned (e.g. cam-oeprod-123456-master)

The old school method is below:

$ ssh user@boiler
 (NIS password)
$ cd /home/xc_tftpboot/pxe/grover
$ ln -sf ../builds/master/cam-prod-008284-master/netboot/pxelinux.cfg

then boot laptop from network

GIT

You MUST set these in the global config

$ git config --global user.name 'Joe Bloggs'
$ git config --global user.email 'Joe.Bloggs@citrix.com'

Optionally, the following will set up any branches you checkout/create in the future with the rebase property set to true, which is useful as this means when you pull, it is the same as running 'git pull --rebase':

$ git config --global branch.autosetuprebase always

To view the global config

$ git config --global -l

To view the local config (i.e. if you're in the directory of a git project it will show you specific config for that)

$ git config --local -l
$ git branch //show branches
$ git branch <name> //create branch called <name>
$ git checkout <name> //switch to branch called <name>
$ git reset --hard <hash> //reset tree to the <hash> of the commit
$ git checkout <filename> //reset <filename> to origin
$ git stash //like diff stack
 :switch branch
$ git stash apply //apply the diff stack on the branch you've switched to
$ git clone <fromtree> <totree>
$ git push <server> <branchfrom>:<branchto> //creates a remote branch based on your local branch
$ git push <server> :<branch> //deletes remote branch
$ git checkout -b test --track origin/test //checkout test branch tracked to test branch locally, create local test branch if not there
$ gitk
$ git commit --interactive
$ git cherry-pick

Debugging Switcher Bar

win-tools.git master change (c7a19d4c9440725f741756485ca3b4ad0d8355eb) mocks out the XenGuestAgent code if debugger attached and either: CITRIX_GUI_DEBUGGING environment variable is defined as non-zero Or File named “IAmACitrixGUIDeveloperAndILikeToTest.txt” is in current working directory.

NIS mount hack on ubuntu

Add this:

 ( sleep 15s ; /etc/init.d/autofs restart ) &

to:

 /etc/rc.local

GRUB Shell

By default the grub shell is disabled in XT. If you want it back you need to add this to your grub.cfg:

 set edit_and_shell=1

Also the grub menu timeout is disabled with:

 set timeout=-1

You can fix that up by commenting out that if/fi block and just set a timeout (in seconds):

 set timeout=5