Wednesday, January 14, 2009

Vpnc and Kde3 KNetworkManager in openSUSE 11.1

I was trying to connect to a VPN network today but network manager failed to connect. A dig through Network Manager's logs revealed an error message 'property 'Disable NAT Traversal' invalid or not supported'.

I googled and found a similar bug report in Ubuntu. It seems that at some point, the option of 'Disable NAT Traversal' got removed from vpnc but knetworkmanager never got updated. As a consequence, the connection fails.

The workaround described is simple and works for me. Just edit .kde/share/config/knetworkmanagerrc manually. Remove the lines:
<string>Disable NAT Traversal</string>\n <string>none</string>\n </entry>\n <entry>\n <string>Enable Single DES</string>\n <string>no</string>\n </entry>\n <entry>\n

Restart networkmanager (sudo /sbin/rcnetwork restart) and knetworkmanager, and try to connect again. This time, the connection should be successful.

I recall a similar bug report filed in bugzilla for opensuse but I am not able to find it now. The bug, if I remember correctly, has being fixed in svn but the fix still hasn't been backported or provided in an update. Till then, this workaround should help you to connect to your vpn network.

Saturday, January 10, 2009

Package Search Module in YaST2

I came to know from this blog that there is a YaST module for searching software in openSUSE package repositories and Packman! Very cool indeed!


But it seems that the devs decided to keep this module invisible in YaST2 even though its there in openSUSE 11.1. Right now, the module can be launched from the command line as follows:

/sbin/yast2 webpin_package_search

But since I find this module to be incredibly useful, I added it to YaST. Here's how to do it. Just open your favorite editor (gedit/kwrite/kate) and paste the following lines in it.

[Desktop Entry]
X-SuSE-translate=true
X-SuSE-DocTeamID=ycc_webpin_package_search
Type=Application
Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Software;

X-KDE-ModuleType=Library
X-KDE-RootOnly=true
X-KDE-HasReadOnlyMode=true
X-KDE-Library=yast2
X-SuSE-YaST-Call=webpin_package_search

X-SuSE-YaST-Group=Software
X-SuSE-YaST-Argument=
X-SuSE-YaST-RootOnly=true
X-SuSE-YaST-AutoInst=
X-SuSE-YaST-Geometry=
X-SuSE-YaST-SortKey=
X-SuSE-YaST-AutoInstResource=

Icon=yast-sw_source
Exec=/sbin/yast2 webpin_package_search

Name=Software Search
GenericName=Search for software in openSUSE package repositories
X-KDE-SubstituteUID=true
StartupNotify=true

Save the file as webpin_package_search.desktop and move it to /usr/share/applications/YaST2 folder. Start YaST2 and you should now see a module called "Software Search" in YaST2.


Launch it to test if the module starts correctly. You now have the package search module easily accessible from YaST.

The devs also mention in the article comments that they are working on an application uninstaller which should do something equivalent to 'apt-get autoremove' in Debian and Ubuntu. Hopefully we should be able to see this in the next release, openSUSE 11.2. Even better would be if the devs can also implement an add/remove software module like the one available in Ubuntu. But I imagine the application uninstaller itself involves a lot of work, so even if they can get that into the next release, it would be really great!

Hope you enjoy using the package search module in YaST! Cheers!

Monday, January 5, 2009

Kdm3 in openSUSE 11.1

The KDE3 desktop installation for openSUSE 11.1 installs, by default, kdm4 or the kde display manager from the kde4 desktop.

Anyone who uses kde3 and finds the switch user options for 'start a new session' and 'Lock current and start new session' particularly useful, installing kdm3 will give you these options back.

For getting kdm3 back, install kdebase3-kdm.

sudo zypper in kdebase3-kdm


Then goto YaST2->System->/etc/sysconfig Editor.

In the tree listing on the left, go into Desktop->Display manager->DISPLAYMANAGER and change its setting from 'kdm4' to 'kdm' (Note: Don't use kdm3).

Save the changes (Click OK Button) and reboot. Kdm3 will now be used instead of Kdm4.

And on a side note, just noticed a lot of new visitors coming from tuxmachines.org. Welcome to my blog everyone!

Sunday, January 4, 2009

Kima in openSUSE 11.1

Just realized that openSUSE 11.1 does not have kima packaged in the KDE community repository. Going through the build service repository, it seems that the build fails on suse 11.1 because of a few additional rpm checks which the build service has added.

A little bit of digging into the new checks and a small patch to the spec file and voila! Kima builds successfully for 11.1!

Get your kima from my home project repository here.

YaST Software Management module in openSUSE 11.1

For anyone who does not like automatically closing behavior of YaST Software Management module (or sw_single) in openSUSE 11.1, I have made a modified package (yast2-packager) which does not close automatically. Get it from my build service home project repository here.

I do not like the self closing behavior myself. No other package manager in any distribution does this. Even add/remove programs in Windows does not do this either. In 10.3, YaST used to ask if we want to install more packages or not, using a popup window. But as people find this popup irritating, the developers removed it. But I don't think whoever who wanted this also wanted the module to automatically close either. In terms of the user, I think the user will find both these things irritating: 1) Popups and 2) Windows which abruptly close without warning. A proper design would be where the number of clicks a user has to perform is least without experiencing the two behaviors described above. Now consider three use cases: 1) Popup removed and window closes automatically 2) Popup removed but the module does not quit. 3) Popup present.

For the first case, if a user does not want to do any futher software changes -> 0 clicks, or if YaST is open too, 1 click to close YaST. Let's give an average of 0.5 clicks.
If user want to make software changes -> if YaST is open, click software module (1 click); or go to openSUSE kickoff menu and click 'Install Software' (1 click); or go to openSUSE menu and click YaST, then click Software Management (2 clicks); All these can increase by one click if the user has the traditional KDE menu or the 'open on hover' feature does not work correctly for the buttons in the kickoff menu. Lets give this case an average of 1.25 clicks. (Note that making the user go through the menu again is not good design).

For the second use case, if a user does not want to do any further software changes-> 1 click to close the module, 2 clicks to close both the module and YaST if open. Let's give this one an average of 1.5 clicks.
If user wants to make software changes-> 0 clicks (module is already open).

For the third use case, if a user wants to make any software changes, click yes when popup is displayed (1 click).
If user does not want to make any changes, click no when popup is displayed (1 click).

Now, lets assign a fixed number of clicks (say 1 click each) to both popup and a self-closing window. So the first case will now have 1 click contribution from the abruptly closing window, the second case will have no contribution and the third case will have 1 click contribution from the popup (Here we are not counting the window closing as the user should be expecting the window to close when he says no).

On tabulating and averaging the clicks for the three cases, you can see that the second case has the lowest number of clicks.


Case 1 Case 2 Case 3
No software changes0.51.51
Software changes1.2501
Popups/closing window101
Average0.920.51


Some more observations: If for the first case, we reduce the clicks for 'more software changes' condition to 1, the average no of clicks will be 0.83 which is still larger than 0.5 for the second case. Further, if we reduce the number of clicks for software changes for the first case and then assume that the user gets accustomed to the window closing on its own, then making the contribution from it zero, the average number of clicks then matches the second case.

Some people may argue that they need something to tell them that software installation was successful or not at the end of the installation process. But then, if something does go wrong, the module does pop up more notifications/warnings than needed already!

In any case, I feel that its best to trust the developers to make the appropriate decision. Since openSUSE is open source free software, we can always make our own customized packages. Feel free to use the package in my repository but remember that its at your own risk!

Wednesday, December 31, 2008

Linux and Vista Hibernation problems

Are you experiencing problems hibernating Windows Vista when you have linux installed in a dual boot setting? Does Vista log you out and show you the login/welcome screen when you try to hibernate your computer? The following may be the cause of your problem.

Vista needs the Windows partition to be marked as the active partition in order to hibernate successfully. To do this, you can use cfdisk utility available on most linux distributions. If you want to use Vista to do this, see the update at the end of the post.

For Ubuntu,
sudo apt-get install cfdisk
My openSUSE already had this installed by default. So fire up the terminal/konsole and sudo/su to cfdisk.


Be very careful with this. Do not make changes you do not understand as if you corrupt the partition table, you might lose all your data, along with the OSs. Be sure to backup your important files.


Look at the partitions and change the 'Boot' flag from the linux partition to the Windows partition. Then select 'Write' to change the partition table. cfdisk may give a message that re-reading the partition table failed. This is normal so don't worry about this.

Reboot to Vista and test hibernation.

Cheers!

Update: Much simpler and easier method using Vista, thanks to Marco:
  1. Boot to Vista
  2. Go to Start menu, right click Computer and select Manage to get the Computer Management window.
  3. Select Disk Management under the Storage category. Your partitions will be shown at the right.
  4. Right click on your Vista partition and choose "Mark Partition as Active". Your Vista partition will most probably be an NTFS partition and will be labelled 'C:'
It's that simple! Now why can't we have something like this in YaST2?

A word of caution: If you have grub setup to boot from the boot partition, this method will cause grub to be skipped while booting and Vista will get booted directly. If this happens to you, use a live cd and restore the boot flags for partitions. Set grub to boot from the master boot record to avoid this from happening.

Friday, December 26, 2008

It works! Broadcom Official Wireless driver (wl) with hidden networks!

If you are using the official Broadcom hybrid wireless driver, either manually compiled or downloaded the one available for openSUSE from Packman, here is a quick fix you can try if you are experiencing problems connecting to hidden wireless networks.

I have a Broadcom Corporation BCM4312 802.11b/g.
You can find which one you have using
/sbin/lspci | grep Broadcom

My wireless network uses WPA2 (WPA-PSK) with hidden SSID. My kernel is 2.6.27 and Network Manager 0.7. A description of the bug (or what I think is the bug) follows:

Description of the bug:

After spending long hours going through the source code for Network Manager, wpa_supplicant and the Broadcom driver itself, I have narrowed down the buggy part to the driver. The problem seems to lie in Broadcom's driver. It does not support 'scan_capa'. So to add this support, you can recompile the driver from the source RPM from Packman along with this additional patch.

diff -uNr hybrid-portsrc-x86-32_5_10_27_11/src/wl/sys/wl_iw.c hybrid-portsrc-x86-32_5_10_27_11_new/src/wl/sys/wl_iw.c
--- hybrid-portsrc-x86-32_5_10_27_11/src/wl/sys/wl_iw.c 2008-12-05 14:41:46.000000000 -0500
+++ hybrid-portsrc-x86-32_5_10_27_11_new/src/wl/sys/wl_iw.c 2008-12-26 11:34:11.000000000 -0500
@@ -580,6 +580,7 @@
range->enc_capa |= IW_ENC_CAPA_CIPHER_TKIP;
range->enc_capa |= IW_ENC_CAPA_CIPHER_CCMP;
range->enc_capa |= IW_ENC_CAPA_WPA2;
+ range->scan_capa = IW_SCAN_CAPA_ESSID;
#endif

return 0;

If you are manually compiling, just make the changes specified by the patch i.e. add this line 'range->scan_capa = IW_SCAN_CAPA_ESSID;' to 'src/wl/sys/wl_iw.c' at the specified place.

Network Manager now uses AP_SCAN 1 for the wl driver, as the driver now reports that it supports SSID scans (scan_capa 0x01). This seems to work for me and Network manager now connects easily to my hidden network without failing 10 times before connecting, like it used to do before. In fact, using AP_SCAN 2, the original wl driver should not even have connected but association is successful even though the connection fails. Network manager caches the SSID of the network and recognizes it next time for which then it uses AP_SCAN 1. Hence the driver sometimes connects successfully after a lot of unsuccessful attempts.

Please let me know if this patch works for you. If something is wrong with this patch or if you want to suggest changes or have anything to say, please feel free to leave a comment.