Saturday, October 31, 2009

Feeds

Want to get updates when I add something to the site? Add my site by adding this link to your RSS reader, or other such things. I have been using Google Reader. It in my opinion is very convenient. Just add this link http://feeds.feedburner.com/SliceOfUnix to your RSS feeder and wowee! Updates on your time.

Adjusting the Network and Updating VirtualBox on OpenSolaris

With school started up, I've not been posting much, and I apologize. However, I did finally replace the motherboard in my main desktop, which has pushed me to use my server more (laptops and wireless weren't working well with the server except to come in, plug into the wired network, and dump. The last dump was 150 gigs, hence it not being convenient to do over wireless). Today, I decided to update VirtualBox since it was complaining that 3.0.8 was available. Due to just having installing VirtualBox on my newly built desktop, I knew that actually 3.0.10 was out, so I went and grabbed it to install. This is probably the third time I've "upgraded" VirtualBox on my OpenSolaris box since installing 3.0.2, but this time I noticed it hung on adding the VirtualBoxKern package, stating that there were already too many. I then realized that I'd never actually upgraded. Heres how to uninstall the old one, and install the newest pacakage.


#pkgrm SUNWvboxkern
#pkgrm SUNWvbox
#pkgadd -G -d VirtualBoxKern-3.0.10-SunOS-r54097.pkg
#pkgadd -G -d VirtualBox-3.0.10-SunOS-r54097.pkg

So happy hunting. I'm still in the process of balancing my computer power again, as I wanted some fast hard drive but accidentally replaced my motherboard with one without on board raid, so I might actually switch the internals of the OpenSolaris box (Phenom II) with the Windows box (Intel Q6600) so I have raid, and can then finally use my hardware raid card (one 16x PCI Express slot means I can't use an 8x slot because of the video card already taking it up). More on that as we go. I'm still also tempted to check out ZFS on FreeBSD...

Monday, September 28, 2009

FreeBSD GUI, Gnome First

Today my goal was to get a GUI up and running on FreeBSD. Due to my own familiarity with it, I chose Gnome. The first thing you'll need to do is either compile from source, or use the package management system. I chose to go the package management route because it usually is quicker. The package required is gnome2, so I ran this command:

#pkg_add -r gnome2

This installs everything you'll need. I then attempted to start the GUI with startx but that didn't work, instead putting me into the basic X11 GUI. I then created a ~/.xinitrc file. I added the following line with the following command:

$echo "/usr/local/bin/gnome-session " > ~/.xinitrc

Then ran

$startx

This failed. I wasn't sure why, so I enabled gdm by editing the /etc/rc.conf file and adding

gdm_enable="YES"

and then rebooting. This time I got an error message, telling me some files were unable to be found. To combat that, I then did some googling and found the suggestion to add the following two lines to /etc/rc.conf

dbus_enable="YES"
hald_enable="YES"

and again rebooting. Like that I was into gnome! Next i'll be looking at getting kde installed.

Sunday, September 27, 2009

FreeBSD, a cheaters way into BSD paradise

FreeBSD was explained to me as linux, but with a different mascot. Without going into that, I have started pushing myself to learn it, due to it being ZFS compatible. I'm debating switching from OpenSolaris to FreeBSD for my fileserver so that I can keep ZFS, but have a little bit more mature system. I'm not set on the switch, but researching my options.

One thing I've run into with FreeBSD is getting my user into the wheel group. This allows my normal user to su into root. As root, you must run

#pw user mod username -G wheel

Log out, log in, and poof kabam, you're ready to go. Look here for continuing tips for FreeBSD as I dive in.

Friday, September 25, 2009

OpenSolaris 2009.11, a Long Term Look

I've been using OpenSolaris 2009.06 for some time now. I have really enjoyed the feeling of security I get with all of my files hosted on my large-ish ZFS pool. However there have been some issues which I would like to bring up, and some other things I would like to compliment.

First, OpenSolaris has great package management software. I haven't found something yet that I'm unable to install except for high end scanner software for scanning film and slides. That cannot be blamed on OpenSolaris. Second, the minor differences in commands from ZFS and Linux are minimal enough that I had no issue learning OpenSolaris. Third, setup was quick and easy and I had a ZFS protected, secure Samba share going in my house in under 15 minutes on a fresh install.

Some of the issues I've come across are the difference in speed between OpenSolaris and Linux. OpenSolaris can be sluggish at times, especially when logging in to SSH. I've also had issues with the built in CIFS occasionally failing, whether due to the computers attaching to it, or the service itself. I installed Samba from source, but eventually went back to the CIFS for simplicity.

So these are some basic views on OpenSolaris after a few months of use. If you haven't tried it yet, I would suggest it as it was rather interesting if nothing more to try.

Tuesday, September 15, 2009

Comparing and Contrasting, OpenSolaris and Linux

Tuxradar has a great article talking about the differences between Linux and OpenSolaris, as well as talking about some of the better features of OpenSolaris. Check it out here.

Monday, August 31, 2009

OpenSolaris plays nice with KDE

I've been spending the last few days, when I have time, playing more with KDE on OpenSolaris, and I must say I've been impressed. The Korona 0.002 release hasn't showed me any real bugs. But because of my limited time lately (school is starting again), I've not been very forceful with it. Again, to get Korona, go to http://genunix.org/

Tuesday, August 18, 2009

KDE on OpenSolaris

In searching for a usb image, I stumbled across http://genunix.org/. This site has tons of images for OpenSolaris and more. One such image is the 0.002 release of the Korona Live distribution, a distribution that allows for KDE on OpenSolaris. After burning the DVD (not cd), I was able to boot right in to KDE without any issue. I've used KDE before, but never gotten to love it so much to use exclusively. For those of you who do love KDE, now you can have your cake (KDE) and eat it too (OpenSolaris).

LiveUSB OpenSolaris

Today I learned about the availability of "liveusb" images for OpenSolaris. Liveusb is like a livecd except much quicker. Because 1GB thumb drives are about as expensive as dirt, its inexpensive, reusable, and much faster. There is a script to "burn" (you're not really burning it) the image to a usb drive on OpenSolaris, and a program to do the same on a Windows book. The script for OpenSolaris is available here. For creating on Windows, you can go here. To use the script/program, you will also need a usb image. In locating the image, I also happened upon a great site that has updated distros (in between full releases), as well as extra projects. Go to http://genunix.org for downloadable usb images, automated install images, cd images, inbetween release images, and anything else you want to do. Not all computers are able to boot from a USB drive. See if yours can in your bios, or if you have one available, a boot menu. The boot drive took about an eighth of the time the cd took to load, and is reusable, quick to "burn".

Samba CIFS and OpenSolaris

I've since learned that the CIFS server integrated into the OpenSolaris kernel is not actually Samba, despite running a smb/server. The integration makes setup much easier to do, however there are some bugs that I've been having lately with prolonged connections. Because of this, I'm going to be trying to setup Samba in OpenSolaris and explaining how to here.

Saturday, August 15, 2009

Walkthrough for Installing OpenSolaris 2009.06

I've written up a walkthrough for installing OpenSolaris 2009.06. You can read it here.

Wednesday, August 12, 2009

Moving from Windows, Installing Mint

In yet another posting on migrating from Windows to Linux, I'm going to show you how to install Mint Linux. Mint Linux has been labeled the "best distro for migrants from Windows", but that doesn't mean it will be the best distro for you. I really enjoy it despite being a huge Linux geek, and not needing something very easy to use. Mint is actually based off of Ubuntu, but that doesn't mean one or the other is better. It just means they have a lot in common. If you read my guide to installing Ubuntu you may notice that the installation screens are extremely similar, sometimes only replacing the orangeish brown of Ubuntu with the green of Mint. That being said, I will show you how to install Mint Linux.

This is the menu you'll get when you first boot from the Live Boot Disc. Just like the Ubuntu boot disc, the Mint boot disc has options for starting the Live version of Linux Mint to test for system compatibility and also see if you like it, but also includes a "compatibility mode" version which may need to be selected if it fails to start up. You also can check the cdrom for errors, your memory for errors, or boot from your local disk. Again, I will just be going through the steps to directly install. To do this, select Start the installer only.

Next, we choose a language, and get greeted by the installer. Its nice to feel welcome isn't it? Select a language you're comfortable reading menus and typing in and click Forward.
Time zone selection! Again, the pretty map. I like it! Choose your timezone with the easy to use map or the almost as easy to use drop down menus.
Choose your keyboard layout. Mint suggests I probably have a USA keyboard (they're right, I don't know how they knew but its making me paranoid....) and I'm trusting, so I didn't type in the low box. That box is there so you can type, and make sure what you type shows up on the screen as you expect it. Once you're satisfied that you are using the correct keyboard layout, click Forward.

Here, I am letting Mint install on the entire harddrive. This is a new harddrive with nothing on it, so I have no problem with Mint hogging it all. If you are using a harddrive with anything you want to keep on it, make backups. Linux allows for partitioning only free space, and sometimes for resizing partitions, but don't trust it. If the data is important to you, dont' trust it to anyone else. If you're more advanced you can partition yourself. Unless you can think of a specific reason why not to, I'd allow Mint to choose my partitions. Click Forward upon making your choice!


Here is where you will put in your username and password. If you read my previous post about installing Ubuntu, skip ahead. If not, this will be good to know. Mint, like some other distros, no longer has you set a root password. The "root" user is the all powerful user who can do administrative tasks such as installs, updates, and other non-end user type things. Now, sudo is used to temporarily give a normal user root privileges. The initial user setup will include the ability to use sudo. Because of this, it is very important that you remember your user name and password. Also, if noone else will have physical access to the box, and you're trusting, you can let it sign you in automatically.

This is the verification screen. If you're advanced, you can click the advanced tab for more options. Otherwise, click Install!



Here, Mint is installing....

And here it is done. Once it is done and you click restart, it will shutdown and hang before turning off so you can remove your cdrom.

Here, you have your GRUB boot loader. Here you can again do a memory test, or you can boot into a failsafe version (think Windows Safe Mode) or into your normal installation, which will be the default.

And here you login with your credentials you've previously set. Notice that the mint login in screen is much prettier then Ubuntu (in my opinion). Oooo pretty...

You're into your new install! Congrats. Notice here we see some differences between Ubuntu and Mint Linux. The Menu button is on the bottom in the same place as a Windows Start menu. Welcome to Linux!

Moving from Windows, Installing Ubuntu

A Guide to Installing Ubuntu

First off, this guide assumes you'll be doing no customization. This is a very basic install. It should also illustrate how easy it is to install Linux. Ubuntu has seven "steps" to installation. I will walk you through these.

This is the screen you will see upon booting from the Live Boot Disc. If you would like to see what your computer would look like with Linux, and also test your hardware for compatibility, you can easily select the first option to boot into a "Live" install. Your filesystem will be untouched, and you can restart with no lasting effects. You will also see options to Install, test the downloaded Live Boot Disc for errors, test your memory, or if you'd prefer not to boot into the live disc at all, boot from the harddrive. THis is important to remember, as if you're like me, you'll forget to remove the disc after your installation, so it will again boot to this menu. For this walkthrough, we're going to skip the live boot (you can do this on your own, no options are required) and go right to the install.

The first installation screen! It gives you the option of selecting a language (default: English) and then tells you to relax and be calm. Select your language and click Next!

Next, we select our timezone for the clock. You can either choose via drop down menus, or you can click a close enough area to where you are on their cool interactive map! This is a new feature since I last installed Ubuntu, so I enjoyed clicking around a but before moving on. Feel free to do this, or move along quickly. Click Forward when ready.


Keyboard layout! This is very important if you want to be able to do anything with the booted system, even log in to change this should you make a mistake. Another new feature, it automatically suggested to me that I was using a USA keyboard. They were right. However, I could've verified this by typing in the box below where it says "You can type into this box..." to verify that what I type shows up on the screen. Once satisfied, click Forward.


Here is where things can get uncomfortable if you're uncertain of what you're doing, or if you're uncertain of what Ubuntu wants you to do. These days, Linux installers are very adept at identifying what you already have installed on your harddrive. If you want to use free space on the harddrive, an option appears to allow you to do this. Because this was a fresh harddrive, my only options were to use the whole disk, or to manually set up my partition tables. Ubuntu is more than capable of doing this for me, so I told it use the whole disk and clicked forward. Make sure you have a backup of anything that is on the drive that you do not want to lose. If you continue past this point, your data will be lost unless you specifically partition around that information. Shrinking partitions is not fool proof and more often than not, I've lost data trying to utilize this feature. My best advice is to get a free harddrive and install on it, allowing Ubuntu to use the entire disk.


This next part is to configure a login for the machine. Many Linux distros still do, or used to, only set up a root password. In Linux, a "root" user is a user with full control over everything. It was designed to not be used unless changes were intended to the system to prevent unintended changes. Ubuntu, as with some other distros, no longer has you set up a root password but instead has you create an intial user who will have the ability to run "root" commands with another program, called sudo. I will discuss sudo more later. For now, fill in your name, a username you can remember, and a password you can remember as well. If you are the only person who will have physical access to the machine, at the bottom you can tell it to automatically sign you in. You can also choose a different name for the system if you so choose.


Review and verify! If you're an advanced user, head on in to the advanced menu and poke around. Otherwise, hit Install.

This is what it looks like while you're installing...

And when your done installing. Click restart here. You won't be able to open your disk drive yet to remove that disk, but once the system has finished shutting down, but before turning off, it'll give you the chance to remove the disk. Hit Restart Now!

Here is the login. It is so dark and ominous! But don't be scared. Using your username and password you set up before, log in.

Here is what your desktop looks like before you start letting Ubuntu know what you're really into. You've done it! You are all installed.


More on migrating from Windows Part 2-ish

Another addition to the move from Windows, is that sometimes it is just nice to have a Windows install. Microsoft Office is a very powerful suite of software. At work, Microsoft Exchange has held back many converts. Virtualization has come around to help fix this, and some employees are switching to Apple computers, with VMWare Fusion installed so they can still use Microsoft software. Earlier, I compared lightly VMWare Server and Sun Virtualbox. Each would be great to install on a Linux install so read the article here.

More on migrating from Windows

The next series of articles will mostly be about transitioning from Windows to Linux. I'm planning how-tos on installation of a few distros, as well as some software to use once in that will be (mostly) universal. However, as I know some people are hesitant to migrate completely due to software availability, I thought I would mention WINE.

Wine stands for Windows Emulator, meaning that it tricks the computer into thinking its installing a program into a Windows environment, and then can (usually) run that piece of software. Wine has also gone further into another program, called Cedega, that allows for gaming with Windows Games on Unix/Linux clients. Wine will run a wide variety of software, with some big names still missing. One of the big names for me, because I do a lot of photography, is Adobe Photoshop. I have yet to successfully install Adobe Photoshop on wine, or really any Adobe software. This is because of Adobe's convuluted installation process. This is one of the exceptions, however.

In OpenSolaris, installing Wine is very easy. First we add yet another repository!

pkg set-authority -O http://pkg.opensolaris.org/contrib contributions
pkg refresh

Then the install

pkg install wine

Easy as pie. In Ubuntu, Mint, and other Debian Linux derivatives, apt-get will be just as easy to install with.

apt-get install wine

And Fedora Core, Redhat, and Centos or other Redhat derivitives can use yum.

yum install wine

As you can see, package management systems have really taken off, and are fantastic additions to Linux and Unix systems, making it very easy to install software anymore. So try out Wine, and make the switch a little bit easier.

Tuesday, August 11, 2009

Pkg tips for OpenSolaris

Often times, a command I want to use is missing while working with zones. That or a library, or an extension. Pkg includes a search function that will completely take care of this for you. Just type

pkg search "named-checkzone"

where in this case I'm trying to find what package includes the command "named-checkzone" and hit enter. Pkg will tell you what package you need!

Folder is in use/busy

So while working with zones, I tried to remove a folder I created as a test, only to have OpenSolaris complain that it was still in use. What I realized was that because it was created as a ZFS dataset, it couldn't be directly deleted, but instead required me to use this following command:

#zfs destory tank/example/dir

ZFS protects itself from being deleted by accident. I thought this was good enough to pass along

Leaving Windows Behind

For many, Windows is the only operating system. But we know this isn't true, as Mac OS X has gained in popularity in recent years, and even Linux has been making headway. So today I want to talk about migrating from Windows to Linux. Up until this point all of my articles, while applicable to other operating systems at their core, were written specifically about OpenSolaris. OpenSolaris, to me, has been a very smooth transition. I don't know getting frustrated, and for the most part have known enough about Linux to avoid getting frustrated in the first place. That being said, for someone wanting to switch to Linux for the first time, OpenSolaris may not be the best bet. Linux is supported by a much larger group, and thus issues are more supported. That being said, lets dive.

Reasons to switch to Linux:
1) Secretly you're a nerd, and want to expand on this
2) You dislike Microsoft
3) You like control over your computer in a way that neither Apple or Microsoft would ever dare allow.
4) You don't like security risks
5) Linux is fun and extremely capable

If you have other reasons, use them, and justify your move. While both Mac OS X and Linux have a shared past, with Unix, they differ in a few ways. For one, Linux is Open Source from top to bottom. That means that everything you're using has been used by a lot of people who know computers better than most people and has been nitpicked over for bugs, becuase they have control. If someone finds a bug, they usually don't submit a bug report form, they dive into the source, the actual code that creates something, and fix it. This means its secure because holes are fixed rapidly, and there is a lot of indepth testing by the community. This makes it much more secure than OSX because its updated often by users who know what it needs without worrying about saving face. Its more secure than Windows because of the same reasons, but like OSX is such a small percentage, noone cares to exploit flaws.

So the easiest way to get into Linux is a Live Boot disc. Live boot discs are placed in your cd-rom tray and your computer is rebooted, and it boots without touching your current filesystem and will run Linux! Hooray! Unfortunately this is slower than a real install, and you can't save anything (for the most part). But it will give you an opportunity to see if you like it, see if your hardware works, and to show off to your other friends who also are secretly nerds. That being said, Linux is not one operating system, its a lot of them, with each being referred to as a "Distro". For new users, the best distro would probably be Ubuntu, a very user friendly operating system with lots of tools that act like their Windows counterparts. To get Ubuntu, go here.

Linux is moving in many directions at once, and Ubuntu is one direction that is very user friendly. Linux offers word processing, email clients, web browsing, flash players, music players, and many other fantastic programs. Another very good distro that looks and feels like Windows is Mint Linux. I'd also suggest trying this out. One of the best things about Linux is the experimentation of different distros, and programs. Mint Linux can be downloaded here.

Keep in mind that Linux is free, as are most programs for it. If you have questions or concerns, please comment below.

Monday, August 10, 2009

OpenSolaris and Adobe

Adobe Flashplayer is very widely used throughout the web. To get it installed on OpenSolaris, Firefox tries to install it, but fails. So you can download a tarball from Adobe. Then what? Follow these instructions

$tar jxvf flash_player_10_solaris_x86.tar.bz2
$cd flash_player_10_solaris_r32_18_x86/

Here you may need to create a folder. Without changing directories, do this

$ls ~/.mozilla

This will show you the directories in your Mozilla Firefox environment. If the folder plugins does not exist, create it now

$mkdir ~/.mozilla/plugins

And then move the lib file into it.

(assuming you're still in the flash_player folder)

$mv libflashplayer.so ~/.mozilla/plugins

Restart Firefox and you should be set.

Saturday, August 8, 2009

Zones, Continued

My cpu use is very low on average. My top shows 0.09 0.08 0.08. I wanted to really see the thing pick up, so I asked about good things to do to waste CPU cycles. The suggestion was Blender, a 3d rendiner software. The only issue, the repository that had it for easy installation through pkg, was in the pending section. "Use at your own risk" isn't always encouraging. So remembering what I learned about ssh -X, and zones, I created a new zone and after going through a whole lot dependencies, was able to get blender up and running.

See the previous post for getting a zone setup. Then I added the following repository.

#pkg set-authority -O http://jucr.opensolaris.org/pending pending.opensolaris
#pkg install blender

Blender installed fine, but didn't run due to missing repositories. I soon realized that the missing repositories were all related to the Xserver, and were not installed in a zone by default, so I would need to individually install them. Here I came to fully appreciate pkg search function. I would attempt to run blender, search for the missing library, install library, try blender. Rinse and repeat. I eventually got it to say "No screen." I was basically done! Just ssh -X zone and I ran it, without any worries about software crashes. Worst case scenario, my zone would crash and I could delete it. I love OpenSolaris

Friday, August 7, 2009

Solaris Zones

Earlier in my experience with OpenSolaris I was concerned about security and so chose to isolate certain server functions through Virtualization. However, virtual machines require disk space, cpu time, and memory. This meant that my server wasn't slow, but it was starting to use its swap memory. And for a box that is barely doing anything, that wasn't acceptable to me. So next, I learned how to disable the GUI. In this quest, I ran into issues, especially when it came to updating. The new Boot Environment (BE) booted into the GUI again. Flustered, I turned to IRC for help and while explaining my issues the main response was, "Weird, but why aren't you using zones?." There are a lot of features of Solaris that differ from other operating systems. ZFS was what initially lead me to OpenSolaris. However, zones would have lead me here too if I had learned about them first.

First, a little bit more about zones. Zones create a completely separate environment on your server. They have their own filesystem, and run commands off of the hardware still. So far it sounds like virtualization. But, they do not have the added layer of virtualization. They are able to communicate with the kernel because it is the exact same operating system. But it is isolated. I log in with different usernames and passwords, I connect to it through a different IP address, I have to add packages to it even if they're installed on my main operating system, or as called while dealing with zones, my Global zone. So my webserver can sit on my main server, isolated with its own traffic, with a much lower toll on my system. While not applicable in every situation, for mine it is amazing.

Lets get one going! First off, the instructions I used to create my zone were incomplete in only one sense: where you put the zone. Zones must be created in a ZFS dataset. Because I have a ZFS filesystem set up already, I merely added another dataset to it. These are the steps requiered to do so.

#zfs create tank/zones/web

If you've read any other post on my blog, or read this one at the beginning, you'll understand that I love zfs, and this should show you why. It is just easy to work wtih. Next, lets set up our zone.

First we'll configure the zone

#zonecfg -z webzone
No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:webzone>create
zonecfg:webzone>set zonepath=/tank/zones/web
zonecfg:webzone>add net
zonecfg:webzone:net>set physical=bge0
zonecfg:webzone:net>set address=192.168.1.109
zonecfg:webzone:net>end
zonecfg:webzone>exit

Let me clarify a few things. First off, the zonepath is where the zone filesystem will be installed. It has to be on a ZFS dataset. It will not give you an error at this point if you have not put it in the right place. Next, the physical nic you are adding to the zone is the physical nic you are using in your system. If you are using e1000g0 then it should be set to that. If there are further questions, submit them in comments and I will try and answer them.

At this point, our zone is configured. Next we need to install it. To verify its configured, we can do
#zoneadm list -cv

In the status, it should say its configured, but not installed (It won't say "not installed" it just will say configured). Next, do the command to install it!

#zoneadm -z webzone install

This will take some time as it installs the entire filesystem as if its a new Solaris install. Once its done, you can do the zoneadm list command shown above to verify. The last thing that will need to be done is to boot the zone. However, the zone must be configured on the first boot like any Solaris install, so it requires two terminals: one to boot it, and one to view the console. For the console do this command:

#zlogin -C webzone

This will show you all output from the zone as it boots, and allow you to set some of the required settings.

On the second prompt, do this:
#zoneadm -z webzone boot

It will go back to the prompt, while your first terminal starts to show a normal boot up of a Solaris system. Fill in the necessary items here and you'll be up and running in no time!

Once my install was up and running, I immediately wanted to install the amp-dev package. However, it became obvious quickly that my zone was not utilizing DNS. It didn't have a /etc/resolv.conf so why should it? In the second terminal you have installed, you can dump your resolv.conf file directly into the appropriate directory. This brings up that the Global Zone can interact wtih the filesystem of all installed zones.

global#cp /etc/resolv.conf /tank/zones/web/root/etc/

this will put your DNS server config into the new server. This wasn't enough though, I also had to do the following command on the zone.

webzone#cp /etc/nsswitch.dns /etc/nsswitch.conf

After this, my system was completely functional and working as I wanted.

If you have any issues, feel free to ask here, or ask in IRC or on the web. Zones, for me at least, provide a more secure method of serving files to myself as well as safely serving files to the outside.

Ethernet Drivers

So far, ethernet drivers have presented the biggest problems for me and OpenSolaris. My AMD board didn't have a widely supported NIC, but I was able to locate a third party driver that worked. I like OpenSolaris so much, however, that I've switched my workstation at work to OpenSolaris. The box also needed a third party driver for the Marvell Gigabit Ethernet card. I did a little bit of Googling and found that the manufactorers website had a driver that supposedly would work. After 30-45 minutes, I got frustrated and ended up back at the site I got my first driver. He had one that he hadn't testing on my NIC, but he thought would work. It worked immediately with no issues. Go here for any NIC driver needs for OpenSolaris. They know what they're doing.

Irssi (command prompt IRC client)

One major improvement, adding colors. Run this command.

/SET term_force_colors ON

It makes it a little prettier.

Thursday, August 6, 2009

More Assistance Elsewhere

Most of what I've learned with Linux, BSD, and now Solaris I've learned in one of three ways: reading about it, trial and error, finding help through google, forums, or IRC. Books are great, because they teach you things you don't know you should know. I've gotten books from the "For dummies" series, the "Head First" series, the "Learn in 24 hours" series, and the "Bible" series. By far, the easiest to use, most instructive, and most helpful has been the Bible series. For working with Solaris, OpenSolaris Bible has been my number one reference. Its worth the money, because its a great resource to use elsewhere as well.

Where to go for help

One nice thing about the internet and most unix distros is that they have followers who are most often willing to help. One great place to get help from these people with experience is through forums. Forums, however, don't work for those of us lacking patience. For this, there are chat rooms, or more specifically IRC, or "Internet Relay Chat". Here there are many people discussing various topics that are above your understand who will kindly devote some attention to your little problems. On OpenSolaris, Pidgin comes preinstalled. Pidgin has chat clients for AIM, MSN, IRC, and anything else I've ever heard of (even ICQ. Do people sitll use that?). Good channels for OpenSolaris? #opensolaris. You join a global server, and from there enter rooms. So, you'd open Pidgin, add an account for IRC, and log on to the freenode server. From there, click join chat, and then enter #opensolaris. You're IRCing!

GUIs use so many resources though! Ew! Want to use IRC through a terminal prompt? Perhaps you've sshed in to your box and want some wild and crazy IRC?

$pfexec pkg install SUNWirssi
or
#pkg install SUNWirssi

Want quick and easy in? Run these in irssi

/CONNECT irc.freenode.net
/JOIN #opensolaris

You're up and chatting.



More on configuration later

Wednesday, August 5, 2009

Paths

While working on web development, which is where this project has taken me, I stumbled across Ruby on Rails, as talked about earlier. One of the most frustrating things so far was while working on rails projects, my path did not include the folder with the ruby binaries. I first tried to do an export command like this

$export PATH=/var/ruby/1.8/gem_home/bin

This worked, except it meant my path ONLY went to that folder. Here is the correct command to add the folder to your path, not make it your only folder.

$export PATH=$(echo $PATH):/var/ruby/1.8/gem_home/bin

This says, i'm exporting a new variable called path. The $( before echo means I'm about to run a command, which in this case just echos the variable $PATH. Then I added what I wanted to add. A quick $echo $PATH will show if you were successful or not.


OpenSolaris, GUI free

My webserver is just that, a webserver. It does not need a GUI. I'd prefer to have resources. I found out how to turn off my GUI today. Here it is

#svcadm disable gdm
or
$pfexec svcadm disable gdm

No more GUI, my top shows less memory use, less cpu use, and that makes me happy.

Tuesday, August 4, 2009

Xservers, TUIs, and GUIs, oh no!

Today I learned something fun. This applies to other distros and such, but it was done, yet again, on OpenSolaris. When you ssh into the box in question, if you're coming from a Unix/Linux/BSD/Solaris box with xserver running, use ssh -X. Then you can run GUIs which appear locally.

$ssh -X theunixblog.blogspot.com
theunixblog$/usr/local/gui-install

The GUI interface for installing will show up where you're connecting from. This is useful for when you have a VM with little to no resources. You boot into the text console, get the ip information, and then start the ssh daemon. On OpenSolaris this is

$pfexec svcadm enable ssh
or
#svcadm enable ssh

Then, connect into the text only box from a GUI unix interface, and run the /usr/local/gui-install and BAM you're doing a GUI install and not using up resources you don't have on the new box.

Security

I spent some time thinking about the trillions of hits I wanted my new website to get, and then immediately starting thinking about the added security I should have to deal with this. Then I realized that the webserver is sitting on my fileserver. Where all my personal files are. No dice. I set up a virtual machine running OpenSolaris (I'm addicted what can I say). This time, setting up web hosting took a little less time. These are the instructions necessary to go from fresh install to fully functional website with ruby on rails, php, mysql, and the whole gang available for use.

#pkg install amp-dev
#pkg install ruby-dev
#pkg install SUNWgcc
#gem install rails
#gem install mysql -- --with-mysql-dir=/usr/mysql/5.1/

#svcadm enable apache22
#svcadm enable mysql


The website is up and functional. This is rediculous. I thought Solaris was hard and frustrating.

On a side note, you should really change the mysql to require a root password. This is easy as well. Here are the necessary commands.

#mysql -u root
mysql>UPDATE mysql.user SET Password=PASSWORD('newpass') WHERE User='root';
mysql>FLUSH PRIVILEGES;

If you're on a linux machine, you probably have access to mysqladmin, so you only need to do this.

#mysqladmin -u root password NEWPASSWORD

All set!

Monday, August 3, 2009

Ruby on Rails, continued

After showing that yes, RoR was up and running, I then tried to follow along a screencast I'd found that took under 10 minutes to have a commentable blog. It failed almost immediately so I set out to find out why.

First off, I learned MySQL and have always used MySQL as my database since learning it. Its opensource, as are others, but I learned it and it makes sense. I've not encountered anything yet that I couldn't use what I already know about MySQL and not learn a new Database. This is called being lazy. Becaues of this, I wanted my RoR apps to use MySQL. To do this, when you create the app you add the -d mysql option.

rails -d mysql myblog

The first time I did this, I started up the application and it crashed. I went back to the first thing I did and found it crashed too. The error log said to install the mysql gem with:
#gem install mysql
This did not work. I found out I didn't have gcc installed, which the gem program needs to install mysql.
#pkg install SUNWgcc
The install still didn't work. I ended up having to add some options.

#gem install mysql -- --with-mysql-dir=/usr/mysql/5.1

And then it all worked.

Vim in OpenSolaris revisited

In OpenSolaris, I kept trying to use vim commands I would use in Linux that would make me want to tear my hear out. In trying to find out the list of possible commands so I would stop tearing out my hair while editing files, I noticed that Vim said it was running in compatibility mode. Apparently, Vim can create/edit files that are compatible with Vi. And editing files with Vi sucks if you're used to Vim. I found out how to break out of this by looking at the help file. I'll make it easier for you.

#touch ~/.vimrc

And done. You will no longer start in compatibiltiy mode anymore. Oh happy days

Ruby On Rails, a blind date

I'd heard of Ruby on Rails, or Rails, or ROR, depending on who you're talking to. I'd never used it, having literally bought my first web development book before ROR existed, and not even looked at THAT book until 2008. Needless to say, I'm behind the times. ROR, like PHP and Python, is a web development language. Its considered good enough by Herr Jobs to be included in Apple OS X, and is supposed to be a breeze. I have no experience with it, and all I will be talking about here is getting it working on OpenSolaris. These instructions are partially from this site.

First, install Ruby
#pkg install SUNWruby18
Gotta love the Solaris package names....
Next, apparently Rubygem is included, but its old. You can either do
#gem update --system
or you can download the source from here.
Then
#gzip -dc rubygems-1.3.5.tgz | tar xf -
#cd rubygems-1.3.5
#ruby setup.rb

Ruby gems is now installed! Next, install rails.
#gem install rails
This can take some time. I was ssh-ed in from a different site and was concerned it was broken/not working, but it finished it up. Next you can test it! Unfortunately, rails did not install into any of my path folders, so I had to manually locate it. Mine was located at:
/var/ruby/1.8/gem_home/bin/rails
Now you're all set! test it by making a site
#mkdir newsite
#cd newsite
#/var/ruby/1.8/gem_home/bin/rails demosite
#cd demosite/
#script/server

Then browse to http://:3000 and see if its there. Mine worked right away after locating the binary rails and running it. Good luck!

Sunday, August 2, 2009

Downsides

I've been using Linux for about ten years, and OpenSolaris for about a week or so now. They are very similar in some aspects, and very different in others. Package management in both is rather sophisticated. OpenSolaris sure has funny names for some of its packages though. I can't get the version of VIM i'm used to run, which is really really frustrating as the old one has issues with when you can navigate around using the arrow keys and such. But overall, I've been really impressed and enjoyed it. I miss Linux sometimes, but not enough to switch. I still have my command line control, easy to use services, and a rather stable (I hope) system.

Saturday, August 1, 2009

All that extra power

I stared at top on my new server for a little bit yesterday and realized it needed more crap loaded up so it would get utilized more. I've been a fan of virtualization, which got some wheels turning. I decided to finish setting up a domain at home, a project I did prior to moving, so I installed Sun's hypervisor, VirtualBox. It was pretty simple. One two download, one decompression, two pkg commands.

>wget http://download.virtualbox.org/virtualbox/3.0.2/VirtualBox-3.0.2-49928-SunOS.tar.gz
>tar xvf VirtualBox-3.0.2-49928-SunOS.tar.gz
>su
#pkgadd -G -d VirtualBoxKern-3.0.2-SunOS-r49928.pkg
#pkgadd -G -d VirtualBox-3.0.2-SunOS-r49928.pkg

Done. One thing I noticed is that running "#virtualbox" crashed, but as normal user it worked fine. I thought it would be harder. Package management takes all the fun out of late night installs. Due to being a student, Microsoft (calm down, they're not completely horrible) allows for legitimate downloads and installs of certain products. Both Microsoft Windows Server 2003 Standard x86 and Windows Server 2008 Standard x86 are available for free with a CD-Key. Go to Dreamspark.com for more information on free software for students. I am currently configuring my domain on Windows Server 2008. I wish it was 64bit but its free, so I'm not going to complain.

On a side note, package management really is unbelievable anymore. The first time I installed apache httpd, mysql, and php it took me a good two days to get it completely functional. Now, on OpenSolaris which is only the second iteration of OpenSolaris I should, I run the following command and its ready to go, with a whole lot of extra that I won't use.

#pkg install amp-dev

AMP is apache mysql php in case you were wondering. As to why I am using Microsoft projects, and talking about it on my blog, Active Directory is amazing. I work with it at work and so feel slightly familiar with it, so went with it. Sometimes diversity is necessary or easier.

Friday, July 31, 2009

Server builds

While I'm chugging away trying to get OpenSolaris all that it can be, my friend was trying to get a server going with CentOS 5.3. One hiccup for him was trying to mount a HFS+ filesystem from his Macbook. The correct syntax to mount a HFS+ is
>mount -t hfsplus /dev/ //

ZFS, CIFS (Samba), OpenSolaris, and Windows Hanging out

I'm pretty pumped. I came home early from work this morning (went in at 4am, came home at 8am), and went to work on the server. First because the raid card wasn't supported in Solaris or OpenSolaris, and I couldn't find third party drivers for it, I moved the 4x 500GB Western Digital Caviar Blue harddrives to the onboard SATA controller. Next, I had some issues with Synergy yesterday where it would take some time to shift between the Windows box and the OpenSolaris box. Fresh out of ideas and sleep, I added in a second NIC which did nothing, as it wasn't supported. I then realized I forgot to turn off my desktop extension to include the second monitor on my Windows box, which would explain the extra "time" or movement necessary to get between the two monitors/systems. I'm with stupid.

I started up the system and tried to remember what to do. This site had some helpful information, but didn't work perfectly, so what I'm showing you is for OpenSolaris 2009.11 and may not work on other versions or even your install. First off, I tried to get the CIFS service working. I did these commands:
#rem_drv smbsrv
#pkg install SUNWsmbskr
#pkg install SUNWsmbs
#add_drv smbsrv
#svccfg import /var/svc/manifest/network/smb/server.xml

And then ran into issues. The smb service showed as running in maintenance mode. A quick google turned up nothing, so I remembered my issues last night and did the magical reboot. When the machine came back up, smb was right there with it. Hooray! I win a prize.

Next, I needed to attach to my workgroup

#svcadm enable -r smb/server
#smbadm join -w WORKGROUP

WORKGROUP is, well, my workgroup name. It connected happily now that I wasn't in maintenance mode anymore. The walkthrough said that there was issues with CIFS and Unix style passwords, so I changed the pam configuration a bit to fix that.

#echo other password required pam_smb passwd.so.1 nowarn >> /etc/pam.conf

After a quick vim to make sure it was truly there, I did

#passwd

That's not what my username is. That's a secret I care not to share. So I was all set! Time for some ZFS zaniness!

The walkthrough I was using directed me to access the ZFS gui at https://localhost:6879/zfs, which I immediately tried and failed at. After more googling, it appears that its not installed and I didn't want to deal with a gui anyways since I had seen a good walkthrough elsewhere without any gui. Enter Simon's Blog! This is what I did:

#format

I know had the list of my harddrives and their names.

#zpool create tank raidz2

I did raidz2 because I'm paranoid and built the file server because I hate losing data and didn't want to anymore. This created a new pool called tank, which is viewable by this command:

#zpool status tank

Also, to see raw data space, and true available space respectively,

#zpool list tank
#zfs list tank

Due to the face that I'm using raidz2, half of my space goes to parity/mirroring/magical protection. Next I set up my destination for my storage space.
#zfs create test/home
#zfs create test/home/media
A quick
#zfs list
showed the mounts to be available, so I moved to the directories and gave my user ownership with
#chown media
#chgrp staff media

Next, I shared it like no preschool teacher could've taught. (if you are a preschool teacher, I apologize and insist I meant no offense, its just where I was taught to share (preschool was where I was taught to share))

#zfs set sharesmb=on test/home/media

Next, find out what its named

#sharemgr show -vp

Then

#svcadm enable -r smb/server

And like that, my server was up and running. I was sceptical. It seemed easy, but why would it be? I switched to the Windows box, did a run \\\media, and BAM there came the sign in. For username, don't forget to put \ otherwise it will most likely try and sign you in as a local (local to the windows box) user. This isn't right. Anyways, after a second of soul searching Windows popped up a new file browser with my test file in it! I was hooked (up). Next, I mapped that baby to my Z: drive, and switched my "Documents", "Desktop", "Downloads", "Pictures", and "Music" folders all to the OpenSolaris box and waited while all of it transferred across. Hooray! Now when I save anything in my documents or pictures folders its replicated protected and error checked! No one will know otherwise! In a word, I'm super pumped. Unfortunately I'm limiting out at 10-ish MB/s transfers, but that's because my windows box NIC can't seem to convince my switch that it can run at gigabit, instead of 100mbit. An item for another day.

Thursday, July 30, 2009

Stubborn

I wasn't going to sleep until I got that damn driver working. I did get it working, the video I watched that showed the install skipped a step that was required for me. Get the driver here if you have an Atheros L1E or L2 networking card. This works for my Asus M4A78-E board. Next run these commands.

#tar xvf atge-2.6.5.tar.gz
#cd atge-2.6.5
#make install
#./adddrv.sh

Then reboot! I wasn't rebooting for the first few tries and was getting frustrated and then rebooted and when I got back in, my network monitor told me my new IP address! Success. I've got synergy going now too so I'm all set to start to set up my ZFS file system and sharing.

Damn these clocks

Further troubleshooting will have to wait. I'm going in to work at 4am tomorrow, so I'm going to bed for now. I'll be back at lunch time to troubleshoot and crunch. I did find some instructions that made it look relatively simple to install the driver, so I'm hopeful.

The pain and humiliation

I spent a good three days researching hardware. I wanted addon card raid, and then I wanted a quadcore 65W processer and I wanted it to be cheap. I thought I was watching for OpenSolaris drivers, but I was obviously not. I got distracted by price and having a second 16x PCI Express slot for my addon SATA raid card, which does not have an OpenSolaris driver (that I've found yet). The card in question, the Adaptec AAR-1430SA on paper seems pretty sweet, but I failed miserably by not checking drivers out first. I'm fully Linux supported and can get along that way, but I want ZFS! The motherboard I got, the Asus M4A78-E does everything fine except the network driver. Atheros L1E? What? This site has a driver that will work, and I'm currently trying to get it working. I can do without the addon card raid, but it would be nice to have. I've installed OpenSolaris 2009.11, and Centos 5.3 (dual boot) each without any trouble during install, just with the Solaris install requiring drivers for the SATA card and networking.

QR-Codes

If the image makes no sense to you, let me explain. First off, this isn't exactly Unix based in any way, its a fun toy I was introduced to today. Many cell phones today can get applications that read barcodes of all types, making it easy to shop around while in a store for a particular item. They also can be used to encode information that can be scanned by someone else. For instance, you could put a barcode on the back of your business card with your contact information. Someone could scan the barcode, and bam they have your contact information in their cell phone. Its crazy! Its genius! Why has it not caught on in America like it has elsewhere?

qrcode

Cable Management, Power Use

With the harddrives and SATA raid card arriving yesterday, I spent some time juggling hardware. I pulled my tv card out of my main workstation as well as the 500 GB harddrive I already had. I also swapped in a 750W power supply from the server, putting the 700W power uspply in the server since it will be on a whole lot more, and the computer seems much quieter. I'm not sure if the 750W power supply is quieter, or if its the dust I blew out, or the lower power draw, but the computer seems much quieter. In the server tower I spent some time trying to get the cabling really limited down so that heat buildup wouldn't ruin anything. The case looks pretty clean so far. The motherboard and CPU are waiting in the mailroom for me to pick them up so tonight I should have it fired up and hopefully ready to go.

Wednesday, July 29, 2009

Virtualization

Microsoft is a widely used operating system for a few very good reasons. First, Microsoft Office is hands down the best option for word processing in my opinion, and Outlook has some very nice features. Also, Active Directory is a relatively good way to keep track of a large amount of domain users. Because of these two things, I find myself forced to use Microsoft Windows and while I enjoy these aspects of it, I still love Linux and Unix and BSD and Solaris. For this I use Virtualization. Now virtualization is an up and coming technology, so there are a lot of changes being made. That being said, here is my experience with two seperate desktop hypervisors.

VMWare. Vmware offers a wide range of products, from desktop hypervisors to enterprises solutions for virtualizing large amounts of servers. They have two desktop products, VMWare Workstation and VMWare Server. VMWare Workstation is not free like Server, so I've used it only in trial settings for short periods of time. It installs as an application and you are able to configure, start, stop and everything else you'll do from this application. The Server version runs as a server, in that there isn't an application specifically for it, and others can connect to it from elsewhere. To access the interface, you use a web browser. The web browser is a bit clunky in my opinion, and I found myself right clicking far too often seeing as it isn't allowed. The virtual machines themselves are opened into the Virtual Machine Viewer, another piece of free software, and you can work with them there. Installs are at times frustrating, its almost impossible to get into the bios to change boot priorities, so if you've installed an OS its hard to install something else overtop of it. I also don't like using the web browser as it isn't always very quick. I used VMWare server for about a year and a half. I never had issues with compatibility, using USB devices on virtualized machines, installing lots of distros of linux and even some Windows installs, installing hacked Mac OS X onto it even.

Virtualbox. Virtualbox is a free solution by Sun Microsystems. It runs as an application and is quick and easy to install. My first install went very quickly, I liked how there was a obtainable POST screen so I could jump into the bios, and they had very intuitive controls for hardware additions and locating media already on the computer. The VMWare solution required the isos to be in the folder with the virtual machines, which at times was frustrating as I would never remember to move them there or didn't want to store them there. Virtualbox can grab them from anywhere and not move them either. Virtualbox does have a lot of pop ups that warn you about interfacing between the virtual machine and your computer, but after clicking the checkboxes for do not show they were out of my way. I've had no problems to date with the Virtualbox, but there have been some things that are slightly annoying. I wish I had more control over my virtual networks. While trying to get two virtual machines to only see each other, I found that the virtual network didn't allow for this. Also, running an ipconfig command on a windows box with Virtualbox throws up an extra six or so virtual interfaces. In its defense, VMWare isn't much better, but it is a little better I feel about how many it adds.

Virtualization is great for when you have a single system, and a desire for multiple operating systems. I've used it for testing software installs, operating system installs, and for live boot isos. Its quick and easy. VMWare makes products for both Windows and Linux and I've run it on both without much difference, and the Virtualbox is available for Windows, Solaris, and Linux.

Tuesday, July 28, 2009

Killing Time

After getting synergy up and working, and overheating my room while playing with OpenSolaris, I made a decision to order some new hardware. I should be getting some parts to set up a OpenSolaris NAS Server. Here is what I will have.

4x 500GB Western Digital Caviar Blue harddrives
4gigs DDR2-800 ECC Memory (I am building the server to keep my data clean, its worth the extra cost)
Phenom II X4 65W Processor (I wanted 65Watt quad core, and I wasn't trying to spend a lot)
160GB System Harddrive (SATA)

The parts should be here soon, and I will get my system together. In the meantime, I've been spending some time trying to get the DHCP server working. I'll walk through the entire process when the system is assembled.

OpenSolaris, first install on physical hardware

I have an old server from 2004-ish. It was a dual processer board with one socket used, and an outrageous 1gb of ram. It had a discrete graphics card, and a single gigabit Ethernet port. I don't' remember what its original purpose was, most likely I used it to host a gaming server and a statistics website for the gaming server. I had planned on upgrading it to dual processer with more memory, but that never happened. It spent most of its life not being used unfortunately. Going to college in the lower forty-eight meant it didn't make the cut and get shipped down. At least not for a while. The point is, though, that its an old server. And OpenSolaris installed without a stutter. It was just as easy as on the VM, but it did take a touch longer since it had to format the disk, which wasn't 8gigs this time. The server was put next to my main workstation, and one monitor was connected to it. At work, I've been using Synergy with Windows 7 and Minty Linux so I can use one keyboard and mouse for two systems without a KVM. If you've never heard of it, go to http://synergy2.sourceforge.com, its worth your time. Great piece of software. Anyways, I decided I would get Synergy up and running between my Vista x64 box and OpenSolaris and found a quick tutorial. Here are the steps to get Synergy installed, which I got from here. This was the first piece of software on Solaris, keep in mind, so I was blown away by the ease of install.

wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libgcc-3.4.6-sol10-x86-local.gz

gunzip libgcc-3.4.6-sol10-x86-local.gz

pkgadd -G -d libgcc-3.4.6-sol10-x86-local

wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/synergy-1.3.1-sol10-x86-local.gz

gunzip synergy-1.3.1-sol10-x86-local.gz

pkgadd -G -d synergy-1.3.1-sol10-x86-local.gz

It was that easy. Because my Windows box served as the server for Synergy, I won't go into the config much. Details on that can be had at Synergy's website. This is the command you run to connect to the server:

/usr/local/bin/synergyc

Instant software KVM. I was very very pleased as this software install was extremely quick and easy, easier than installing it on Linux, although that could be because I had installed it on Linux before.

My physical install went quick and easy, and I had a system I could easily work on with my single keyboard and mouse. That was until the heat generated by the old Xeon box heated the office up to 85 degrees and stayed there, and the CPU fan picked up speed to help cool it. Back to the drawing board!

OpenSolaris, first install, first impressions

The Live Boot iso means that trying out OpenSolaris is easy, very easy. However, I wanted to really test out the "easy to use" ZFS set-up. I've been using VirtualBox, another Sun Microsystems product oddly enough, for a while and setup a new virtual machine to test out the OpenSolaris. I work in an office that does mostly server administration and support, and often I've heard the word Solaris thrown around as a curse word in the few occasions it is worked on, so I was skeptical. But right away, the familiar GRUB boot loader began, and then into the familiar Gnome desktop. First off, let me point out that I've tried a lot of distros of Linux, both KDE and Gnome, and I must say that the default desktop caught me off guard by how clean yet attractive it was. The default profile was eyecatching and new! What else could I ask for? To start the install there is a nice easy install icon shortcut on the desktop, like many recent live distros. The install was very quick, very easy, and before I knew it I was watching the bar as it installed itself. Granted I was using a virtual machine, and it was an iso image, the install was quick. A quick reboot and off I went to OpenSolaris-land.

I added four small drives to the virtual machine and within 5 minutes had what is called a raid-z2 array. It was really really easy. I was impressed. Next step was trying it out at home.