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....


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!

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.

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.


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.


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.
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!
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
#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.
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.
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.
/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.
Subscribe to:
Comments (Atom)









