Search This Blog

Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Wednesday, 14 May 2014

Citrix Receiver on Ubuntu 14.04

Woohoo, got my new work laptop today, a Lenovo Thinkpad T430.

I didn't even boot into Windows, just stuck the Ubuntu CD in and installed 14.04 64 bit.

I now have it pretty much set up the way I like it, but Citrix Receiver (of all things!) gave me some troubles and I thought I'd better document what I did for next time I decide to re-install.

Firstly, the Ubuntu Wiki page on installing ICA Client is very good. It can be found at https://help.ubuntu.com/community/CitrixICAClientHowTo and there is even a section on installing Citrix Receiver 12.1 on 64 bit 14.04. It is a great shame that Citrix have created a .deb which will not install, and which needs to be fixed and repackaged before it is useable, but the instructions are simple to follow, and it installed correctly when I followed them.

The the next gotcha hit. Open XenDesktop, and it opens full screen. Even when Windowed mode is selected in the ICA Client configuration. That's a problem right there, as there is no simple way of getting back to your Ubuntu Desktop, other than using some extra key combos or logging off the XenDesktop. Neither of these make for an easy or productive work experience.

I asked around on the net and found very little help, except in the Citrix community forums, where one guy suggested I set the desired Horizontal and Vertical resolution globally. This worked, and I thought I'd document it here too, if only for my own use in the future.

The file I edited to force the resolutions I wanted was:

/opt/Citrix/ICAClient/config/All_Regions.ini

and the values I changed were from

DesiredHRES=*
DesiredVRES=*


to

DesiredHRES=1024
DesiredVRES=768

This means that when I open my XenDesktop now, it opens in a window 1024x768 which I can then maximise like any other window. This means I can put the maximised XenDesktop window in one workspace and my other stuff in the other 3 workspaces and easily flick back and forth between them.

Et voila! Productivity restored!

Thursday, 10 January 2013

A Tale of 2 Disks

I'm sorry if you were waiting for part 2 of the LVM saga, it will come, but in the meantime, I've something else to talk about.

I had a normal 500GB hard drive in my work laptop and I was reasonably happy with the performance, with Ubuntu 12.04 booting to an xmonad Window Manager, it took about 55-60 seconds from power button to login window.

However, some of my work colleagues have put SSDs into their computers, both desktop and laptop, and that gave me the idea to try that too.

Because I do a lot of work on my XenDesktop at work, and I also extensively use ShareFile and Dropbox, the size of the SSD was less important to me than the reviews it received. I store a lot of the non sensitive stuff I use on some form of cloud service, so a smaller, faster disk was fine by me.

I got a 128GB Crucial M4 SSD and installed Ubuntu 12.04 on it, again using xmonad as my WM. And boy, does it make a difference! Boot from power on to login screen now takes 19 seconds. Copying some large files from my backups to the new system was way faster than I'd dared hope, in fact copying about 6GB of files, assorted between large and small files, took around 3 minutes. I can tell you that I was very happy.

In general use I find things are faster too, opening 500MB+ files in Wireshark is so much quicker, file transfers from anywhere are so much quicker and generally the whole system feels more responsive.

So, if you've been thinking about SSDs, stop it! Get yourself one and see what a difference it really makes. With prices down so low now, there is no real reason to not use one for the OS of a computer. Even if the data is stored elsewhere, having the OS and some programmes you use a lot on an SSD really does make a difference. Just remember to enable the TRIM feature....

Monday, 7 January 2013

Fun with LVM (Part 1)

Ok, I lied a little, it's not really a lot of fun, but I'm hoping to create something useful (to me at least) here.

I don't work with LVM extremely frequently, it's one of those things I set up and tend to forget about, so when I need to make some changes, I find I have to look at the same old man pages again and again. I thought I could make my life easier and create a single post with most of the information I need in one place.

What makes this blog post different to any of the other millions already out there, I hear you say? Nothing, except that I'll find this one easier to find and hopefully writing it all up will cement it in my own head. So, here goes:

My lab has the following layout, all created in a VM:
HDD1   8GB       250MB /boot | LVM PV1 | 1GB swap
HDD2   8GB       LVM PV2
HDD3   15GB     MDRAID Disk1
HDD4   15GB     MDRAID Disk2
HDD5   15GB     MDRAID Disk3

The three mdraid disks are combined into a 30GB RAID5 volume, with a single LVM PV (LVM PV3) created on top.

PV1 and PV3 added to Volume Group 1 (VGlab) with separate LVs for /, /var, /home and /var/log with Ubuntu Server Edition 12.04 installed on top. LVM PV2 unused for now, and not all available spave in VGlab used.

So we have a server with the following output from df -h after a clean install:


stefan@lvm-lab:~$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/lab-os    4.7G  683M  3.8G  16% /
udev                  241M  4.0K  241M   1% /dev
tmpfs                 100M  292K   99M   1% /run
none                  5.0M     0  5.0M   0% /run/lock
none                  248M     0  248M   0% /run/shm
/dev/sda2             223M   25M  187M  12% /boot
/dev/mapper/lab-home  4.7G  198M  4.3G   5% /home
/dev/mapper/lab-var    14G  473M   13G   4% /var
/dev/mapper/lab-log   7.5G  257M  6.9G   4% /var/log
stefan@lvm-lab:~$


So we can then start using some of the commands to see what's going on and making some changes.

The first command which is useful is pvdisplay which lists out the physical volumes present in the physical machine. Bear in mind that this will list any volumes, physical or RAID, which have a LVM volume flag set. On my lab, I get the following output:


stefan@lvm-lab:~$ sudo pvdisplay
  --- Physical volume ---
  PV Name               /dev/md0
  VG Name               lab
  PV Size               29.99 GiB / not usable 0
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              7678
  Free PE               0
  Allocated PE          7678
  PV UUID               Marv0q-qLZJ-HWOt-mVUC-FKoS-zqT8-K5C214
 
  --- Physical volume ---
  PV Name               /dev/sda3
  VG Name               lab
  PV Size               6.84 GiB / not usable 4.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              1749
  Free PE               1560
  Allocated PE          189
  PV UUID               rIZb3g-GZdJ-yuGY-UC2k-iG0G-Q4f3-2TmS9R
 
  "/dev/sdb1" is a new physical volume of "8.00 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/sdb1
  VG Name            
  PV Size               8.00 GiB
  Allocatable           NO
  PE Size               0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               jgePi7-SkVo-7kp2-KUdQ-Ajel-MQFU-Ubs4PH
 
stefan@lvm-lab:~$


You'll note that the first entry is the RAID array and the second is the LVM section of the first disk. You'll also note that the other 8GB disk is listed, even though it has not been added to a VG yet.

A similar command vgdisplay can be used to list all Volume Groups, in this lab I only haver a single VG but this would list all VGs present:


stefan@lvm-lab:~$ sudo vgdisplay
  --- Volume group ---
  VG Name               lab
  System ID          
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                4
  Open LV               4
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               36.82 GiB
  PE Size               4.00 MiB
  Total PE              9427
  Alloc PE / Size       7867 / 30.73 GiB
  Free  PE / Size       1560 / 6.09 GiB
  VG UUID               BgXqr1-gDCJ-OLzC-dYgV-2qa1-nzL2-95jpZx
 
stefan@lvm-lab:~$


As expected, there is also a similar command to view the Logical volumes in the VG as well, lvdisplay.


stefan@lvm-lab:~$ sudo lvdisplay
  --- Logical volume ---
  LV Name                /dev/lab/os
  VG Name                lab
  LV UUID                fYXl5R-NlHb-44Gs-rQWh-IiRE-3aaQ-fHusdk
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                4.66 GiB
  Current LE             1192
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     4096
  Block device           252:0
 
  --- Logical volume ---
  LV Name                /dev/lab/home
  VG Name                lab
  LV UUID                GUGN3K-ICHB-VnvE-GvcK-16nP-Q20e-pyAqse
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                4.66 GiB
  Current LE             1192
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     4096
  Block device           252:1
 
  --- Logical volume ---
  LV Name                /dev/lab/log
  VG Name                lab
  LV UUID                OagOZY-fvan-ji02-92UA-bv2r-EQuS-SEebSH
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                7.45 GiB
  Current LE             1907
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     4096
  Block device           252:2
 
  --- Logical volume ---
  LV Name                /dev/lab/var
  VG Name                lab
  LV UUID                0wztzb-mQOj-5Gp8-L21T-TIKP-1gcT-cermwT
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                13.97 GiB
  Current LE             3576
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     4096
  Block device           252:3
 
stefan@lvm-lab:~$


So there is a pattern emerging here, the commands are generally the same, just the prefix of pv-, vg- and lv- changes. There are also a number of switches which can be used to shape how each command runs more intelligently. For example, to see information on only a single Logical Volume, with units in kB, you would run the following:

stefan@lvm-lab:~$sudo lvdisplay --units K /dev/lab/var

The man page for each command does a good job of explaining these various switches and options.

In the next installment, I'll be looking at how a series of commands can be used to interact with the LVM elements, such as adding PVs to an existing or new VG, altering the size of a VG, altering the size and/or number of LVs in a VG, and also look at some gotchas when it comes to the filesystems on the Logical Volumes.

Friday, 4 January 2013

Going Minimalist with xmonad

You may have read in my ramblings how I am one of these people who actually likes Unity on Ubuntu and find it lets me get more stuff done. Well, I still think that, but in the last few days I've been tempted into looking elsewhere for some thing different...

One of the guys I work with runs Arch Linux and uses xmonad as his window manager. No, I'm not going down the painful path of Arch, but I have decided to take a look at xmonad as an alternative WM on my (Ubuntu running) work laptop. (Thanks Michal....)

Talk about a learning curve! It is very different to Unity in that it is minimalist, has no eye candy and uses the keyboard much more than the mouse. But what a fast and responsive way of working it has proved to be!

Installation was a breeze

sudo apt-get install xmonad

and following the 2 links here and here made the initial config reasonably easy. Here are my xmonad.hs and .xmobarrc config files:

xmonad.hs

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
myWorkspaces = ["1:terminal","2:web","3:XenDesktop","4:four","5:five","6:six","7:seven","8:eight","9:nine"]
main = do
    xmproc <- spawnPipe "/usr/bin/xmobar /home/stefan/.xmobarrc"
    xmonad $ defaultConfig
        { manageHook = manageDocks <+> manageHook defaultConfig
        , workspaces = myWorkspaces
        , layoutHook = avoidStruts  $  layoutHook defaultConfig
        , logHook = dynamicLogWithPP xmobarPP
                        { ppOutput = hPutStrLn xmproc
                        , ppTitle = xmobarColor "green" "" . shorten 50
                        }
        }


.xmobarrc

Config { font = "-*-Fixed-Bold-R-Normal-*-13-*-*-*-*-*-*-*"
       , bgColor = "black"
       , fgColor = "grey"
       , position = TopW L 90
       , lowerOnStart = True
       , commands = [ Run Network "wlan0" ["-t","Wireless: Rx<rx>|Tx<tx>","-S","True"] 10
                    , Run MultiCpu ["-t","Cpu: <autototal>","-L","30","-H","60","-h","#FFB6B0","-l","#CEFFAC","-n","#FFFFCC","-w","3"] 10
                    , Run Memory ["-t","Mem: <usedratio>%"] 10
                    , Run Swap [] 10
                    , Run Date "%a %b %_d %l:%M" "date" 10
                    , Run StdinReader
   , Run Network "eth0" ["-t","Wired: Rx<rx>|Tx<tx>","-S","True"] 10
                    ]
       , sepChar = "%"
       , alignSep = "}{"
       , template = "%StdinReader% }{ %multicpu% | %memory% * %swap% | %eth0% | %wlan0% | <fc=#ee9a00>%date%</fc> "
       }


These 2 files will provide a reasonable starting point for anyone wanting to try this out.



I have 2 specific comments though:

Firstly, I'd forgotten how much I love tinkering with Linux. Using it every day to put in a full day's work is good, especially compared to the Windows alternative, but it's really nice to tinker with a new setup and alter it to do exactly what you want. In my case it involved writing a small script to start trayer, a small tray utility to display applets like those in the system tray, and some applets which I use a lot like the Network Manager and Bluetooth applets.

#!/bin/bash

# Script to start trayer and required applets
trayer --edge top --align right --SetDockType true --SetPartialStrut true  --expand true --width 10 --transparent true --tint 0x191970 --height 13 &
sleep 3
nm-applet --sm-disable &
sleep 3
bluetooth-applet &
sleep 3
dropbox start
exit 0


This script is called from a small wrapper script which sets my display options to my work configuration, with an external monitor to the right of my laptop.

#!/bin/bash

xrandr --output LVDS1 --mode 1600x900 --output VGA1 --mode 1680x1050 --right-of LVDS1
/home/stefan/.tray.sh
exit 0


I also had to tweak some other settings to get xmobar to display the data I wanted to see in the status bar. Ok, this is all done automatically in a full desktop WM like Unity, but I enjoyed tinkering, tweaking and ending up with a desktop that works for me.

Secondly, it is amazing just how much my work is streamlined using a tiling window manager and using keystrokes to flick between desktops, monitors and open windows. It is difficult to imagine the difference made by not moving my hands from keyboard to the mouse and back as much. I still use the mouse in browser windows etc. but for the majority of my work I can get away with only using my keyboard.

I guess in short, it has once again been brought home to me how versatile Linux is, and how easy it is to customise to your own requirements. If you don't like one Desktop Environment, use another, just be comfortable with whatever you use.

I'll be using Unity and xmonad interchangeably from now on...

Thursday, 9 June 2011

I got it! I am now an Ubuntu Member!

Well, as I said in my last post, I was applying for Ubuntu Membership based on my activity in the Ubuntu Forums. I found out a day or so ago that I've been accepted along with 18 other active forum members.

Happy days!

I just need to continue my work now and maintain my activity levels as best I can, but I think it is a personal milestone for me.

Thanks to all who supported my application.

Friday, 3 June 2011

Ubuntu Community Involvement

Just recently, I've been looking at the community structure in Open Source development in general and Ubuntu in particular, and how users can get involved in helping out.

I have been active in the Ubuntu Forums for a long time now, specifically in answering questions and helping new users in the Security and Server Edition sub-forums. I got involved in this because the Ubuntu Forums helped me immensely when I started using Ubuntu, and then when I felt confident about the new skills I was developing, I wanted to help others who were in the same boat as I had been. I still ask questions too, the forums are a fantastic resource, but it is also very satisfying to be able to help people solve  problems they are coming up against.

On the foot of this, I have applied to become an Ubuntu Member, and I am waiting on whether this will be approved or not, but as a part of this application process, I was pointed to Launchpad and the myriad of ways that users can contribute there.

While I am not a coder, I feel that I am able to help out with documentation and translation, and as a result I have joined both a Ubuntu Community Documentation Team and a UK English Translation Team. This means a whole new world of IRC meetings and mailing lists, but I find it very fulfilling to be a part of the community who is attempting to give something back.

So for those out there who use Linux and have often felt they would like to give something back, but are unsure how, it is worth taking the plunge. Read plenty, listen plenty, help in small ways first. Whatever you do, get involved, and become a part of the Free/Open Source Software revolution.

Thursday, 2 June 2011

Unity Part 2

Ok, it's now official. I like the new Unity desktop environment on Ubuntu. In my last post I said I'd give it a fair crack, and it has really grown on me to the point that I now am back to using Ubuntu almost exclusively, only booting to Windows 7 when I need to for some MS Word/Internet Explorer integration work for a customer, where I need to test that out, but that is the only time when I need to use Windows.

It is nice to be able to hit the Windows key on the keyboard, type the first few letters of the name of the programme I want to use and just hit enter. I still have my most used programmes on the Launcher, like Chromium, Thunderbird, the Terminal, LibreOffice Writer and Tomboy Notes, but so far I've not had the need to create desktop shortcuts, which is a novelty for me!

I was at this stage before of course, but the Unity DE did slow me down for a while when I installed Natty, but at this stage I don't think I'll go back to Gnome. I know there is still a lot of Unity hate around out there, but I really think that it is not the disaster it has been made out to be, and that it can actually make Ubuntu useable to a whole new range of people while allowing the "old hands" to do pretty much anything they were doing before.

Now I just need to work on convincing everybody else......

Thursday, 19 May 2011

Unity'd we Stand

There has been a great deal of comment, both negative and positive, about the use of Unity as the default Desktop Environment on Ubuntu 11.04, Natty Narwhal.

At first, I was underwhelmed and somewhat put out about this change, especially with the news from Mark Shuttleworth that from the 12.04 release, Unity would be the ONLY DE as default on Ubuntu. I felt that this was a move in the wrong direction on the part of Canonical. However, I resolved to at least try Unity and see what the fuss was about.

I installed Natty Narwhal on my laptop alongside my regular Windows OS (for work) and booted it up, only to find myself terribly confused. I couldn't find my settings, I found it difficult to get to my most used applications and I was generally very confused.

However, at the exact same time, I also installed Natty on a friend's laptop. His Windows 7 install had suffered a terminal virus infestation, and for a variety of reasons I couldn't re-install Windows, so I suggested he try Ubuntu. Now, this chap has grown up on Windows and as most young people today are, is very active online with his Facebook, MSN and other online social networking systems. He took to it like the proverbial duck to water. He found his way around very quickly, and when I had shown him the Ubuntu Software Centre, he loved it. He has been using it for a few weeks now and still loves it, and he hasn't found anything which he cannot do on Ubuntu yet.

I suppose it has illustrated to me that there is a positive side to the Unity move. It seems to make it easier to switch to Ubuntu when coming from a background of heavy phone interface use, and it seems to be easy to pick up and do basic customisations on.

I am going to persevere with it for a while longer, I've found all my settings and have customised it to approximately to the way I want it to look so I can access my most used functions easily. It may not be the reason to leave Ubuntu I originally thought it may be, and I'm more determined than ever to give it a fair trial. And I suppose that if I don't like it, I can also install Gnome3 later......

Monday, 9 May 2011

Hyper-V Woes

I have been quiet lately, for a variety of reasons, but I'm back and ready to moan.

I've just had my first attempt at working with MS Hyper-V, and boy was it fun! Now, before I start, I'm not MS bashing for the sake of it here, I was determined to give this a good go and do my best to a simple system up and running quickly. I'd also like to point out that I DO have experience in working in Virtual environments, in VMware ESXi, VirtualBox and a little bit of KVM.

Setting up the VM parameters was great, nice and easy, just like using VMware Infrastructure Client but with the added advantage of working on the localhost rather than across a network. We'll not go into why the physical server is in Australia and how I accessed the physical server, that is for another day's blog.
"I like this!" I thought.........
Installing the Ubuntu 10.04 LTS OS was next and started off quite well, chose my options etc, but then I got "No Network Adapter Found" error message, things started to go pear shaped. I Googled and found a solution which involved loading hv modules at boot by generating a new initrd image. Great, easy. Or not.....

No dice. Nada. Zip. Nothing. No network connectivity at all. "Ok, I'll try some other suggestions" I thought. I tried setting a legacy adapter in Hyper-V, manually starting the hv modules and restarting networking, editing the interfaces file, multiple reboots, but still the NIC is not recognised.

So I have an installed VM server with no connectivity, only just above the chocolate teapot in terms of usefulness then.

Next thing to try is a full re-install (thank goodness it's Linux and only takes 15-20 mins start to finish) but I'm not holding out much hope....and I was right not to. I installed VirtualBox on the Windows server and had my VM up, running and configured in less than half an hour.

The thing is that this process just worked on ANY OTHER virtualisation platform I've tried it on. I was not trying to do something difficult or out of the ordinary, it was a bog standard install of a simple server OS. Now before anybody takes a pop at me and says that the problem lies with Linux for not having the kernel modules to work with Hyper-V, that is not relevant, especially as the kernel modules were loaded. If MS are serious about Hyper-V becoming a VMware beater, they need to provide support for as wide a collection of guest OSs as possible. I've just wasted several hours of my life trying to use what is supposed to be an enterprise class system to do something very simple, which it refused to do. Fail Microsoft, fail.