Archive for the ‘Linux’ Category

How to Encrypt Partition under Ubuntu 11.10

Friday, December 9th, 2011

Here is a quick how-to for password protecting and encrypting your partition using cryptsetup under Ubuntu/Kubuntu Oneiric Ocelot. It should work for older versions too but haven’t tested it.

cryptsetup luksFormat /dev/sdaX
 
cryptsetup luksOpen /dev/sdaX cryptname
 
mkfs.ext4 /dev/mapper/cryptname
 
echo 'cryptname /dev/sdaX none luks' >> /etc/crypttab
 
mkdir /media/cryptname
 
echo '/dev/mapper/cryptname /media/cryptname ext4 defaults 0 2' >> /etc/fstab

Obviously you have to be root and have cryptsetup installed.
PS: I’m NOT responsible for any damage or data loss caused by executing the supplied code.

VMware Player / Workstation Mouse Grab Input Focus Bug

Tuesday, September 22nd, 2009

To fix the recent bug with VMware Player 2.5.3 and Workstation 6.5.3 Build 185404 under Karmic Koala Ubuntu just paste this line in your console before launching vmplayer/vmware:

export VMWARE_USE_SHIPPED_GTK=yes

you may also modify the VMware starting script so you don’t have to export it every time.

MDADM RAID Failed After Upgrade from Ubuntu 8.10 to 9.04

Friday, April 24th, 2009

With no surprise the update from Interpid Ibex to Jaunty Jackalope was not as easy as I hoped. After booting the fresh 2.6.28 kernel I was welcomed with “Press enter for maintenance (or type Control-D to continue)” and errors when trying to mount my RAID0. After some investigations found that the devices are now named md_d* and there are some devices in /dev/md/.  Because of this change I had to do the following things to get my raid up and running:

  1. Reassemble the raid (check if it is inactive with less /proc/mdstat) – in my case the command looked like this: mdadm --assemble /dev/md_d1 /dev/sdb2 /dev/sda5
  2. mdadm --detail --scan >> /etc/mdadm/mdadm.conf and comment your previous ARRAY definition in the config file
  3. Modify /etc/fstab if needed

Also if DKMS fails to build the new NVIDIA driver be sure to check that you have installed the headers files (the upgrade process did not install them for me).

Again : I’m NOT responsible for any damage or data loss you might experience. Backup often, backup soon!

How-to Increase Adept’s Font Size under KDE4 (Kubuntu)

Monday, January 5th, 2009

One issue that was bugging me for a while was the different font size (after adjusting it) on couple applications (including Adept) under my fresh installation of Kubuntu Interpid. After investigating and Google-ing I found out that it was due to running those proccesses as “root” which had different fonts and GTK+  settings.

Solution:

$ kdesudo systemsettings

After running the command above setup the font size as you like it. Working as normal user is something new to me and I’m not sure I like. Needing to write my pass to many times and having to chown my old files is just not that pleasant.

VMware Player / Workstation Keyboard Mapping Problem

Monday, January 5th, 2009

After switching from Debian Unstable to Kubuntu 8.10 I reinstalled my VMware Player 2.5.1 and started my Windows XP virtual machine. Soon I found that most of the keys near the numeric pad (del, home, right enter, etc) are either not working at all or doing wrong things. The obvious reason was some wrong keyboard mappings.

Solution:

$ echo 'xkeymap.nokeycodeMap = true' > ~/.vmware/config

or if the config already exists

$ echo 'xkeymap.nokeycodeMap = true' >> ~/.vmware/config

More info here

How-to Install VMware Player / Workstation on 2.6.26 Kernel

Monday, August 11th, 2008

Following the series about VMware troublesome installation here is a short tip for having VMware Player or Workstation up and running on your linux box.

  1. Download latest patch from the Google VMKernelNewbies Group (currently 117d)
  2. Extract it to some tmp directory
  3. Execute runme.pl

It could not get any easier than this (well maybe VMware can update more often)

How-to Install Nvidia Driver on 2.6.25-2 Debian Kernel (with Xen)

Sunday, May 25th, 2008

Another big surprise rolled out from the Debian Unstable repository when today I updated my kernel from 2.6.25-1 to 2.6.25-2 – the maintainers have enabled Xen in the non-Xen kernel (linux-image-2.6.25-2-686). The result from this is that Nvidia drivers don’t compile throwing error about Xen enabled kernel.

The solution (if you don’t want to recompile your own kernel) :

As usual backup before executing any of these :)

  1. cd /lib/modules/2.6.25-2-686 (or wherever are your modules)
  2. grep CONFIG_XEN . -Rl | xargs -i sed -i -e ‘s/CONFIG_XEN/CONFIG_LUPO/g’ {}
  3. export IGNORE_XEN_PRESENCE=1
  4. sh NVIDIA-Linux-x86-173.08-pkg1.run (or you can use patched 169.12 – http://www.nvnews.net/vbulletin/showthread.php?t=110088 )

Source: linux-image-2.6.25-2-686: nVidia driver fails to compile due to active Xen support

How-to Install VMware Player / Workstation on 2.6.25 Kernel

Wednesday, May 7th, 2008

Update: Looking for 2.6.26 howto – here you go !

After the successful How-to install VMware Player and Workstation on 2.6.24 Linux kernel and with 2.6.25 up and running on my Debian Unstable (Sid) I had no option but to update the procedure.

  1. Download latest and greatest products from VMware
  2. Install and patch as described in the previous post (use vmware-any-any-update-116.tgz)
  3. Download the vmware-any-any-update-117-very-ALPHA.tgz
  4. Extract the archive in /usr/lib/vmware/modules/source (or wherever are yours vmblock.tar, vmmon.tar, vmnet.tar)
  5. Run vmware-2.6.25.sh and then vmware-config.pl
  6. If compiles – have fun, if not drop me a line :)

Important notes:

  1. The original author of the patches is 6xx I have modified the vmmon.patch since otherwise I was getting the error at the bottom of the article. The original patches can be found here
  2. vmware-2.6.25.sh is a very dumb script – read it carefully before executing. It will be even better to paste the commands one by one
  3. This any-any patch has nothing to do with the original any-any patches by Petr therefor I do not want to take the credit for it. All I’m trying to achieve is to gather the Linux VMware community here and share ideas. If someone wants to help and make the patches more unified and smarter just drop me a mail (can be found on the home page)
  4. I take no responsibility for any problems or damage that may
    occur as a result of using any of the information contained in this article.
    Use the information at your own risk ;)

Error log:

include/asm/page.h: In function ‘pte_t native_make_pte(pteval_t)’:
include/asm/page.h:128: error: expected primary-expression before ‘)’ token
include/asm/page.h:128: error: expected ‘;’ before ‘{’ token
include/asm/page.h:128: error: expected primary-expression before ‘.’ token
include/asm/page.h:128: error: expected `;' before ‘}’ token
include/asm/paravirt.h: In function ‘pte_t __pte(pteval_t)’:
include/asm/paravirt.h:955: error: expected primary-expression before ‘)’ token
include/asm/paravirt.h:955: error: expected ‘;’ before ‘{’ token
include/asm/paravirt.h:955: error: expected primary-expression before ‘.’ token
include/asm/paravirt.h:955: error: expected `;' before ‘}’ token
include/asm/paravirt.h: In function ‘void pmd_clear(pmd_t*)’:
include/asm/paravirt.h:1171: warning: missing braces around initializer for ‘pud_t’
include/asm/paravirt.h:1171: warning: missing braces around initializer for ‘pgd_t’
include/asm/paravirt.h:1171: error: cannot convert ‘pud_t’ to ‘pgdval_t’ in initialization
make[2]: *** [/tmp/vmware-config2/vmmon-only/common/task.o] Error 1
make[1]: *** [_module_/tmp/vmware-config2/vmmon-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.25-1-686'
make: *** [vmmon.ko] Error 2
make: Leaving directory `/tmp/vmware-config2/vmmon-only'
Unable to build the vmmon module.

Howto Convert Vmware Windows XP IDE Disk to LSILogic SCSI

Sunday, April 13th, 2008

I quite often use my Windows XP VM running under Vmware Server 1.0.5 (Debian Unstable) and because I still don’t have RAID I am forced to try every possible performance optimizations.

Latest and greatest was when successfully converting my 10 GB preallocated IDE disk to LSILogic SCSI following procedure close to this one. (Try it on your risk !)

1.Create LSI Logic disk:

vmware-vdiskmanager -c -s 100mb -a lsilogic -t 0 tempDisk.vmdk

2. Add SCSI definitions in your VMX file:

scsi0.present = "TRUE"
scsi0.virtualDev = "lsilogic"
scsi0:0.present = "TRUE"
scsi0:0.fileName = "tempDisk.vmdk"

2. Boot the VM and install LSI Logic driver – use WHQL 1.20.18.00 (at least I could not install the latest version)

3. Make backup of the VM Disk !

4. Open the disk definition file (.vmdk). Get from there the disk size (sum of all extents)

# Extent description
RW 20971520 FLAT "WXP-flat.vmdk" 0

Then create another disk

vmware-vdiskmanager.exe -c -s 20971520 -a lsilogic -t 1 anotherTemp.vmdk

This one is only needed so you can get the new geometry and replace it in the original .vmdk

5. Replace old geometry with new from anotherTemp.vmdk. In my case I replaced this

ddb.adapterType = "ide"
ddb.geometry.sectors = "63"
ddb.geometry.heads = "16"
ddb.geometry.cylinders = "16383"

with this

ddb.geometry.cylinders = "1305"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.adapterType = "lsilogic"

6. Update you VMX file so scsi0:0 points to the main disk image.  Also you can remove the old IDE definitions.

7. Boot your VM and have fun.

Couple of other performance suggestions:

1. Always defrag your guest operating system disk.

2. Use MemTrimRate = "0"

3. Use scsi0:0.mode = "independent-persistent"

4. Keep your guest operating system as light as possible. Turn off themes, effects, unneeded services etc.

Resources used:

http://sanbarrow.com/ide2scsi.html

http://communities.vmware.com/thread/50084

New features expected in KDE4.1

Saturday, February 9th, 2008

Just checked out an interview with Sebastian Kuegler (KDE developer) about the upcoming features in KDE4.1 :

I think the part that most people — just like me — are really looking forward to is an improved Plasma desktop shell. It really is the most visible part of the desktop. The good news here is that Plasma, a relatively young subcommunity within KDE is really alive and kicking. We’ve already been able to fix most of the problems that were still there in 4.0.0, and if we continue to keep the current pace of development, it looks like we have exceeded feature parity in those part with the 3.5 series already by summer.

Then of course, I’m looking forward to KDE-PIM in 4.1. It will make use of the Akonadi storage framework and as such be more stable and usable as the 3.5 series. Then, just recently, Dragon Player has been merged into our 4.1 tree. Dragon Player is a very simple but powerful video player, which of course makes use of Phonon, our new multimedia framework. For non-Linux/UNIX users, 4.1 will also bring the first stable applications to Mac OSX and Windows, which is another very big thing in my eyes.

Other features include more scripting support, newly ported applications (Amarok for example seems to be aiming for a summer release as well), performance improvements all over the place, new plugins for the KWin window manager with its nifty compositing features, and many more.

This really suggests what I expect from the KDE 4 series, new, innovative and really exciting features and improvements at a steady pace. With the KDE 4
series, we’ll simply outperform our proprietary competitors in terms of speed of innovation and user orientation.

More information on this topic can be found on Sebastian’s blog

Full interview link