AdSense Mobile Ad

Monday, May 4, 2009

Enabling Dell Vostro Wifi network adapter on Solaris Express Community Edition (build 110)

I unfortunately had to configure a Dell Vostro laptop: the machine's not bad but as soon as I see the typical Broadcom {Solaris, Linux}-unsupported Wifi card I would start to scream and run away.

Configuring ndiswrapper on Linux is pretty straightforward: it's a small project which usually compiles without issues using the typical GNU toolchain of your preferred distro. If you use Debian you can recompile the ndiswrapper module for your kernel-of-the-day using modules-assistant without any pain.

Solaris is another beast and an NDIS-wrapper is being actively ported by the OpenSolaris Laptop community. Installation is not straight forward and I experienced some issues worth mentioning here.

Have you got the Windows drivers?
If you're planning to use an NDIS wrapper because your Wireless NIC is unsupported the first thing you need is the Windows driver. Take into account that the wrapper is meant to work with NDIS version 5.0 or above: Windows 2000 driver will probably work but best results will be accomplished with Windows XP and Windows 2003 Server drivers. Also, 32-bit drivers nowadays offer more stability than 64-bit drivers which, in many cases, does not even work as expected.

Have you got the right version of the tool chain?
Laptop community home page suggests the following:
  • GNU C Compiler v. 3.4.3 or superior
  • flex
Both are present on Solaris 10 in /usr/sfw/bin.

Have you got ON-specific build tool?
This is something that is indeed mentioned in the Laptop Community homepage. OpenSolaris 2008.11 provides them in /opt/onbld/bin but neither Solaris 10 nor Solaris Express Community Edition (as of build 110) ships them with the OS. If you're using such a system, download the SUNWonbld package at the OpenSolaris Download Center.

Get ndis.
Grab ndis source taking into account the version of the OS you're running. The Laptop Community page will suggest the correct version for the system you're running.

Build the driver.
The steps to build a driver are pretty straightforward. Let's start with the 32-bit version of the driver:
  • First unzip the ndis source tarball into some directory and then copy the 32-bit driver's inf and sys files into the i386 folder of the ndis distribution.
  • (Optional) Convert the inf file into a plain ASCII file with:
# iconv -f utf-16 -t ascii driver.inf > ndis.inf
  • Build the driver:
# make ndiscvt
# ./ndiscvt -i ndis.inf -s ndis.sys -o ndis.h
# make ndis
# cp bcmndis /kernel/drv/bcmndis
# make ndisapi
# cp ndisapi /kernel/misc
These steps will install the 32-bit bcmndis driver. This is where the official Laptop community page isn't clear, in my humble opinion. A 32-bit driver can be built while running a 64-bit kernel but it cannot be used that way. If you plan to use this driver you'll have to skip the following section and go directly to GRUB configuration for Solaris 32-bit.

Building a 64-bit driver.
If you've got the 64-bit version of the driver (you probably have in some installation CD and if you don't, check your PC vendor's home page) you can try and build a 64-bit version and see if it runs with Solaris. I had not so much luck with this Dell Vostro 1710, equipped with a Broadcom Wifi chip (14e4, 4315) but some cards are reported to work. To build a 64-bit version the steps are essentially the same:
  • Copy the 64-bit driver's inf and sys files into the amd64 folder of the ndis distribution.
  • Build the driver:
# make ndiscvt
# ./ndiscvt -i ndis.inf -s ndis.sys -o ndis.h
# make ndis
# cp bcmndis /kernel/drv/amd64/bcmndis
# make ndisapi
# cp ndisapi /kernel/misc/amd64
Try to use the driver.
Assuming everything went fine, you can now add your driver into your Solaris and try to use it. As explained, if you built a 32-bit only driver, you should run the 32-bit Solaris kernel. That said, you can type:
# add_drv -i '¨(pci-vendor-id, pci-device-id)¨'

The PCI IDs can be found by using scanpci or checking your hardware documentation. In the Dell Vostro 1710 case they were (pci14e4,4315).

Booting a 32-bit Solaris.
To boot a 32-bit Solaris the easiest approach is editing GRUB menu and adding a specific entry. In my case I added the following:
title Solaris Express Community Edition snv_110 X86
findroot (pool_rpool,0,a)
kernel$ /platform/i86pc/kernel/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/boot_archive
The Dell Vostro 1710 experience.
Well... I built both the 32 and the 64 bit drivers but unfortunately the 64-bit one panics my system immediately. So I'm booting a 32-bit Solaris when I need the wifi card and the 64-bit Solaris the rest of the times. I'm not very happy because rebooting is a pain and, moreover, the 32-bit system with wifi enabled sometimes crashes, even if I don't know why yet.

A strange font problem using Solaris Express Community Edition build 110 and Blastwave's packages

After live upgrading SXCE from build 104 to build 110 I started to experience a problem which makes it impossible to use some (current) Blastwave's packages.

After launch, xine immediately core dumps:
grey@solaris1:~$ xine
This is xine (X11 gui) - a free video player v0.99.4.
(c) 2000-2004 The xine Team.
xiTK WARNING(xitk_font_load_font:725): loading font "*-helvetica-*-i-*-*-12-*-*-*-*-*-*-*" failed, default and system fonts "xiTK received SIGSEGV signal, RIP.
Abort (core dumped)
Core file says:
grey@solaris1:~$ pstack core
core 'core' of 3361: xine
----------------- lwp# 1 / thread# 1 --------------------
c99d22a5 _lwp_kill (1, 6, 8043e18, c997ab7e) + 15
c997ab8a raise (6, 0, 8043e68, c9951ffa) + 22
c995201a abort (813b66c, 1, 23, 815a128, c9a50000, c9392a00) + f2
080e9829 ???????? (b, 0, 8043f50, 80e9718)
c99c01bf call_user_handler (b) + 2af
c99c03ef sigacthandler (b, 0, 8043f50) + df
--- called from signal handler with signal 11 (SIGSEGV) ---
c99447a0 strlen (813ae1c) + 30
c9992b90 fprintf (815a128, 813ae1c, a3c0730, 0, 816dce8, 815a128) + a8
080c514b xitk_font_load_font (321, 646f636e, 816e020, 816e027, 816e038, 816e040) + 9bb
09230064 ???????? ()
----------------- lwp# 2 / thread# 2 --------------------
c99cd049 __lwp_park (8159c90, 8159c78) + 19
c99c678d cond_wait_queue (8159c90, 8159c78, 0, c99c6c56) + 60
c99c6cce __cond_wait (8159c90, 8159c78, c8bdee70, c99c6d13) + 86
c99c6d21 cond_wait (8159c90, 8159c78, 813c040, c99c6d54) + 24
c99c6d69 pthread_cond_wait (8159c90, 8159c78, 0, 0, 0, 0) + 21
0811a763 ???????? (0, 0, 0, 0, 10300, 43560000)
4d580000 ???????? ()
----------------- lwp# 3 / thread# 3 --------------------
c99d0fe5 __nanosleep (c8a6ef90, c8a6ef88, 0, 10c11d08, 0, 1dcd6500) + 15
c9ac25b6 xine_usec_sleep () + 6a
----------------- lwp# 4 / thread# 4 --------------------
c99cd049 __lwp_park (82626d8, 82626c0) + 19
c99c678d cond_wait_queue (82626d8, 82626c0, c834ef28, c99c6976) + 60
c99c6b53 cond_wait_common (82626d8, 82626c0, c834ef28, c99c6d96) + 1eb
c99c6dee __cond_timedwait (82626d8, 82626c0, c834efb0, c99c6e80) + 66
c99c6e91 cond_timedwait (82626d8, 82626c0, c834efb0, c99c6ec4) + 27
c99c6edc pthread_cond_timedwait (82626d8, 82626c0, c834efb0, c834efb8, c834efb8, 82626c0) + 24
c9a9e38e ???????? ()
----------------- lwp# 5 / thread# 5 --------------------
c99d1d15 __pollsys (816d820, 1, 0, 0, 5, c920e000) + 15
c9977834 poll (816d820, 1, ffffffff, c90e69ca) + 4c
c90e6aa7 _XWaitForReadable (8169170, c920e000, c819ee64, c90e79ff) + eb
c90e7b40 _XReply (8169170, c819ee7c, 0, 1) + 2c8
c90f2df2 XSync (8169170, 0, 48003bb, 8262d58, a548800, 0) + 72
c81b48cb ???????? ()
----------------- lwp# 6 / thread# 6 --------------------
c99cd049 __lwp_park (8a9b6ec, 8a9b6d4) + 19
c99c678d cond_wait_queue (8a9b6ec, 8a9b6d4, 0, c99c6c56) + 60
c99c6cce __cond_wait (8a9b6ec, 8a9b6d4, c807eed4, c99c6d13) + 86
c99c6d21 cond_wait (8a9b6ec, 8a9b6d4, c807ef10, c99c6d54) + 24
c99c6d69 pthread_cond_wait (8a9b6ec, 8a9b6d4, 8a9b6c8, 8a9b6fc, c807ef10, c99c5258) + 21
c9aaaf08 ???????? (0, 0, 0, 0, 10300, 43560000)
4d580000 ???????? ()
----------------- lwp# 7 / thread# 7 --------------------
c99cd049 __lwp_park (8262f70, 8262f58) + 19
c99c678d cond_wait_queue (8262f70, 8262f58, c7f4ed24, c99c6976) + 60
c99c6b53 cond_wait_common (8262f70, 8262f58, c7f4ed24, c99c6d96) + 1eb
c99c6dee __cond_timedwait (8262f70, 8262f58, c7f4eda0, c99c6e80) + 66
c99c6e91 cond_timedwait (8262f70, 8262f58, c7f4eda0, c99c6ec4) + 27
c99c6edc pthread_cond_timedwait (8262f70, 8262f58, c7f4eda0, 8a7c300, 0, 49fee5a8) + 24
c9aa8231 ???????? ()
----------------- lwp# 8 / thread# 8 --------------------
c99cd049 __lwp_park (8fd8d1c, 8fd8d04) + 19
c99c678d cond_wait_queue (8fd8d1c, 8fd8d04, 0, c99c6c56) + 60
c99c6cce __cond_wait (8fd8d1c, 8fd8d04, c7e4fee4, c99c6d13) + 86
c99c6d21 cond_wait (8fd8d1c, 8fd8d04, 8fd8cf0, c99c6d54) + 24
c99c6d69 pthread_cond_wait (8fd8d1c, 8fd8d04, 0, 8fd8d04, c9adccb8, 8fd8cf0) + 21
c9aa0edc ???????? (a41ce40, 1, 82651f0, 8bdf660, 8a7cd80, 8fd8cf0)
08bdf430 ???????? (0, 823e788, 815c688, 815c6b0, 817ab50, 0)
08203230 ???????? (c9a9f760, c9a9f23c, c9a9f3c4, c9a9f9d8, c9a9faac, c9a9f6e8)
c9a9f54c ???????? (892c2474, e818245c, 19fc, dc38c381, 6c890003, f6852424)
8b1c2474 ???????? ()
----------------- lwp# 9 / thread# 9 --------------------
c99d0fe5 __nanosleep (c7d3ef68, c7d3ef60, 0, 0, 0, f4240) + 15
c9ac25b6 xine_usec_sleep (c9aa84a0, c9aaa724, c9aaa738, c9aaa72c, c9aaa7d4, c9aaa118) + 6a
c9aa9fd4 ???????? (4893442, 5a10ff24, 768dc3, 3118ec83, 1bac0, 7c890000)
8b082454 ???????? ()
----------------- lwp# 10 / thread# 10 --------------------
c99cd049 __lwp_park (99f8664, 99f864c) + 19
c99c678d cond_wait_queue (99f8664, 99f864c, 0, c99c6c56) + 60
c99c6cce __cond_wait (99f8664, 99f864c, c7c1eed4, c99c6d13) + 86
c99c6d21 cond_wait (99f8664, 99f864c, 0, c99c6d54) + 24
c99c6d69 pthread_cond_wait (99f8664, 99f864c, 99f8640, 99f8674, c7c1ef10, c99c5258) + 21
c9aaaf08 ???????? (0, 0, 0, 0, 10300, 43560000)
4d580000 ???????? ()
----------------- lwp# 11 / thread# 11 --------------------
c99cd049 __lwp_park (9b6056c, 9b60554) + 19
c99c678d cond_wait_queue (9b6056c, 9b60554, 0, c99c6c56) + 60
c99c6cce __cond_wait (9b6056c, 9b60554, c7b1ff70, c99c6d13) + 86
c99c6d21 cond_wait (9b6056c, 9b60554, c99c56da, c99c6d54) + 24
c99c6d69 pthread_cond_wait (9b6056c, 9b60554, c9adccb8, 9b60554, 9b60550, 1) + 21
c9aaedfc xine_event_wait (0, 0, 300, 43560000, 0, 0) + 38
43560000 ???????? ()
----------------- lwp# 12 / thread# 12 --------------------
c99cd049 __lwp_park (9b6109c, 9b61084) + 19
c99c678d cond_wait_queue (9b6109c, 9b61084, 0, c99c6c56) + 60
c99c6cce __cond_wait (9b6109c, 9b61084, c7a20ed0, c99c6d13) + 86
c99c6d21 cond_wait (9b6109c, 9b61084, 0, c99c6d54) + 24
c99c6d69 pthread_cond_wait (9b6109c, 9b61084, 0, 9b61084, c9adccb8, 9b61070) + 21
c9aa0edc ???????? (0, 0, 82651f0, 9b61070, 0, 9f83cc8)
09b60f60 ???????? (0, 823e788, 815c688, 815c6b0, 817ab50, 0)
08203230 ???????? (c9a9f760, c9a9f23c, c9a9f3c4, c9a9f9d8, c9a9faac, c9a9f6e8)
c9a9f54c ???????? (892c2474, e818245c, 19fc, dc38c381, 6c890003, f6852424)
8b1c2474 ???????? ()
----------------- lwp# 13 / thread# 13 --------------------
c99cd049 __lwp_park (9fa5134, 9fa511c) + 19
c99c678d cond_wait_queue (9fa5134, 9fa511c, 0, c99c6c56) + 60
c99c6cce __cond_wait (9fa5134, 9fa511c, c7921f70, c99c6d13) + 86
c99c6d21 cond_wait (9fa5134, 9fa511c, c99c59b2, c99c6d54) + 24
c99c6d69 pthread_cond_wait (9fa5134, 9fa511c, c9adccb8, fe000, 9fa5118, 1) + 21
c9aaedfc xine_event_wait (0, 0, 300, 43560000, 0, 0) + 38
43560000 ???????? ()
----------------- lwp# 14 / thread# 14 --------------------
c99cd049 __lwp_park (9fa5c64, 9fa5c4c) + 19
c99c678d cond_wait_queue (9fa5c64, 9fa5c4c, 0, c99c6c56) + 60
c99c6cce __cond_wait (9fa5c64, 9fa5c4c, c7822ed0, c99c6d13) + 86
c99c6d21 cond_wait (9fa5c64, 9fa5c4c, 9fa5c38, c99c6d54) + 24
c99c6d69 pthread_cond_wait (9fa5c64, 9fa5c4c, 0, 9fa5c4c, c9adccb8, 9fa5c38) + 21
c9aa0edc ???????? (0, 0, 82651f0, 9fa5c38, 0, a39f158)
09fa5b28 ???????? (0, 823e788, 815c688, 815c6b0, 817ab50, 0)
08203230 ???????? (c9a9f760, c9a9f23c, c9a9f3c4, c9a9f9d8, c9a9faac, c9a9f6e8)
c9a9f54c ???????? (892c2474, e818245c, 19fc, dc38c381, 6c890003, f6852424)
8b1c2474 ???????? ()
----------------- lwp# 15 / thread# 15 --------------------
c99d1d15 __pollsys (c766ebf0, 1, c766eca4, 0) + 15
c997ce11 pselect (7, c766ef40, 0, 0, c766eca4, 0) + 199
c997d1e6 select (7, c766ef40, 0, 0, c766ecd8, 0) + 78
080a4f1c ???????? (0, 0, 0, 0, 0, 0)
00000000 ???????? ()
----------------- lwp# 16 / thread# 16 --------------------
c99cd049 __lwp_park (a3c13f4, a3c13dc) + 19
c99c678d cond_wait_queue (a3c13f4, a3c13dc, 0, c99c6c56) + 60
c99c6cce __cond_wait (a3c13f4, a3c13dc, c756ff90, c99c6d13) + 86
c99c6d21 cond_wait (a3c13f4, a3c13dc, c99cc027, c99c6d54) + 24
c99c6d69 pthread_cond_wait (a3c13f4, a3c13dc, c99cacb8, c9a50000, fe000, 0) + 21
0811cb99 ???????? (c8ed7a00)
c99ccff0 _lwp_start (c8ed7a00, 0, 0, c9a50000, fe000, 0)
----------------- lwp# 17 / thread# 17 --------------------
c99d0fe5 __nanosleep (c6e0ef90, c6e0ef88, 0, 13d5084, 0, 5f5e100) + 15
c9ac25b6 xine_usec_sleep (0, 0, 0, 0, 0, 8ad3e18) + 6a
4d580000 ???????? ()
The same problem shows up with other packages such as Gnucash. I also thought something went wrong during the live upgrade process so I installed SXCE build 110 from scratch on another machine and the problem still appears. I didn't upgrade to build 111 or 112 because of the nVidia problem I read about and I'm now downloading build 113 to see if the problem still persists.

Sun xVM VirtualBox v. 2.2: USB support on {Open}Solaris works and HP's multifunction printers work like a charm.

As I told you on another post I had some problems with VirtualBox on a Solaris host: missing USB support not only meant that USB devices were unmanageable, it also meant that other software (such as HP's solution center for multifunction printers) wouldn't even install because of that missing feature. I planned to use my printer though the Ethernet interface but the software wouldn't install.

Until I installed Sun xVM VirtualBox v. 2.2. Experimental USB support was sufficient for HP's software to install and the printer worked perfectly both from Windows and Linux guests. Direct access to the printer by setting up a filter was straight forward.

A note about networking configuration: HP's solution center uses a certain number of TCP and UDP ports to communicate with the multifunction device. The printer documentation was detailed and setting up a firewall or a set of NAT rules wouldn't be hard. By the way, once I realized that the problems I was experiencing with the scanner were due to VirtualBox's default network configuration, I decided to change the guest's network settings.

If you're a Solaris Express user who regularly updates its system, you'd probably read about Crossbow project. Crossbow project, which was integrated in Nevada build 105, aims to provide the building blocks for network virtualization on Solaris hosts. The first thing I thought about was, indeed, creating a virtual NIC. But the solution was easier than that and it's called "Bridged networks" on VirtualBox's jargon. You simply change the adapter configuration for you VirtualBox host from NAT to Bridged and you optionally choose the physical NIC you want to bridge upon, in the case your system has more than one. Boot your guest OS and you'll have a virtual NIC at your disposal, without the limitations of the NAT configuration. And if you are communicating with the "outside world", such as a network multifunction printer or some CIFS client, your guest OS' NIC will appear just as a physical NIC.

The only caveat to use this technique is that, on Solaris hosts, Virtual NICs and VirtualBox bridged networking isn't implemented (yet) on top of a Wireless NIC.

Enjoy,
Grey

Sunday, April 12, 2009

Sun xVM VirtualBox 2.2: Experimental USB support for OpenSolaris hosts

I really never had the need of even thinking about USB support on VirtualBox until I bought an HP OfficeJet 6500 multifunction printer at home. I chose that printer because it has a network interface and it was (more or less) supported by HPLIP Linux driver: I thought it could work with some hacking with Solaris as well. Worked indeed in Solaris but there was no hope to have the scanner work with Sane (let alone the fax...). No problem, thought I: I'll run a Linux or a Windows on VirtualBox and use HP's software.

Well: HP Windows software does not install if it detects that the OS doesn't support USB. No way to go, even if at the beginning of the installation I chose "Network attached printer". No way. USB support is good news for everybody and as far as it concerns myself, I hope to be able to launch and perform HP's software installation.

Edited: I finally had the time to setup another Solaris host and, indeed, everything is working fine.

Bridged networking in Sun xVM VirtualBox 2.2

If you're using Sun xVM VirtualBox as your desktop virtualization platform you'll surely be familiar with the default networking options applied when you create a Virtual Machine: the default configuration applied is NAT networking.

NAT networking is surely suitable to basic networking needs (such as surfing the web) but it early shows its limitation as soon as the user tries to use not only P2P programs or VOIP clients: it also shows its limitations using Windows file sharing. I personally experienced many troubles with Windows file sharing oreven being a CIFS client from a Windows guest to a Solaris host. Not mentioning the problems I had while trying to run some propietary piece of software such as HP Solution Centers to run my little home printer. No way.

If you're curious about NAT types and NAT limitations, you can look Wikipedia NAT entry and Sun xVM VirtualBox User Guide, too. If you just want to scratch the surface, think of a host behind router: the host is the host OS and the router is VirtualBox internal NAT engine. The host can see the network through the router and the machine is unreacheable from outside the network. Opening ports on the router so that certain services could be accessible is possible but it requires configurations. Even so, VirtualBox NAT engine introduces some further limitation. Summarizing: even if it's a default zerco-conf option, I would avoid using NAT because you could run into some problems difficult to diagnose.

Bridged networking (formerly known as host networking)
The solution to this problem was formerly known as host networking which have recently been dubbed bridged networking in the recent VirtualBox releases. In the earliest VirtualBox versions this configuration required some work and even if it was pretty easy to accomplish in most guests, such as Linux or Solaris, it was undoubtely a power user configuration. On Solaris, for example, project Crossbow greatly simplified dealing with such issues: not only with VirtualBox but in every use case in which you could benefit a virtual NIC.

Sun xVM VirtualBox 2.2 has just been released and bridged networking has been greatly simplified: you can now choose that option and your guest OS will be assigned a NIC which effectively is a new network interface in software. Your guest OS will not experience any limitations and you'll be able to freely run your software as if the guest OS were a real box connected to your network. This also means that the internal DHCP server you were using with NAT configurations cannot be used and the network adapter must be configured somehow. If you are using a residential gateway with an integrated DHCP server you'll probably have no problems booting your virtual machine, being assigned an IP number and being able to use your network immediately. If you have a more complex network configuration, just configure your NIC.

I just tried this networking option on Linux (including on a wireless NIC) and on Solaris Express Community Edition build 110 and it works like a charm. Every problem I had with Subversion or with the CIFS client has disappeared without the need of creating a TAP interface (on Linux) or a VNIC (on Solaris). Easier than ever!

Enjoy!