Platform :
FreeBSD
Objective :
List or show PCI devices
Command :
Showing posts with label FreeBSD as Desktop. Show all posts
Showing posts with label FreeBSD as Desktop. Show all posts
2011-03-14
2010-07-26
FreeBSD - How to allow normal user to mount USB drive
Recently, I've got a few external hard disk and one of them is formatted into file system FAT32 (msdosfs or vfat), because the files are to be interchange between Linux, OSX & FreeBSD. After the files are save from OSX, the external hard disk cannot be mounted onto FreeBSD or PC-BSD as a normal user. Since these are just some media files and frequently need to be interchange between these 2 OS, I'm quite reluctant to mount it using root or sudo. After all, root or sudo are suppose to be used for system administration.
On the FreeBSD box, some system value & devfs needed to be change in order for the external USB hard disk can be mounted. As for PC-BSD, the "hald" failed to mount the USB external hard disk because this USB external hard disk FAT32 partition is too big. Some changes needs to be done on "hald" but being a command line geek, I'd rather meddle these in command line. By the way, the error message pops out on the "Dolpine" (KDE) file manager is :
"An error occurred while accessing '160gb', the system responded:
org.freedesktop.Hal.Device.Volume.UnknownFailure: mount_msdosfs:
/dev/msdosfs/160gb: Disk too big, try '-o large' mount option : Invalid argument"
Again, "If doubt, refer de FreeBSD Handbook" shed light. These steps are to be executed as root or equivalent privilege. Also, the normal user that is intended to mount the external hard disk, need to be part of the group "wheel". Below are the steps that I've taken to allow normal user to mount a external USB drive :
On the FreeBSD box, some system value & devfs needed to be change in order for the external USB hard disk can be mounted. As for PC-BSD, the "hald" failed to mount the USB external hard disk because this USB external hard disk FAT32 partition is too big. Some changes needs to be done on "hald" but being a command line geek, I'd rather meddle these in command line. By the way, the error message pops out on the "Dolpine" (KDE) file manager is :
"An error occurred while accessing '160gb', the system responded:
org.freedesktop.Hal.Device.Volume.UnknownFailure: mount_msdosfs:
/dev/msdosfs/160gb: Disk too big, try '-o large' mount option : Invalid argument"
Again, "If doubt, refer de FreeBSD Handbook" shed light. These steps are to be executed as root or equivalent privilege. Also, the normal user that is intended to mount the external hard disk, need to be part of the group "wheel". Below are the steps that I've taken to allow normal user to mount a external USB drive :
2010-07-19
FreeBSD - How to compile custom kernel
Normally, the generic kernel that comes with default FreeBSD installations are good enough for most installations. But some machines that I worked on are having more then 4gb of memory. Be default, the i386 processor architecture only recognizes 4gb or less memory. Any random access memory larger then 4gb, the kernel will need to enable the feature PAE (Physical Address Extension) in order to make use of the processor's extended physical address space, from 32-bin to 36-bit. After compiling PAE kernel feature, the 4gb limit will increase to 64gb.
Most of the time, I re-compile the kernel because of the server hardware comes with more then 4gb of memory. But recently I'm setting up a firewall that need to do traffic shaping, through QoS (Quality of Service). PF's ALTQ feature will do the traffic shaping, but by default, it is not included in the default kernel.
This post will show how to compile custom kernel in FreeBSD so that it includes the ALTQ feature :
Most of the time, I re-compile the kernel because of the server hardware comes with more then 4gb of memory. But recently I'm setting up a firewall that need to do traffic shaping, through QoS (Quality of Service). PF's ALTQ feature will do the traffic shaping, but by default, it is not included in the default kernel.
This post will show how to compile custom kernel in FreeBSD so that it includes the ALTQ feature :
2010-07-17
FreeBSD - How to reset root account password
After the initial installation, the root password should be changed to a complicated enough password, then forget it. We're not suppose to use the root login & password as it might exposed to unnecessary risk. My preferred way of system administration should use sudo. It's more secure, controllable, and flexible.
But things happen. Today, I've totally forgotten root password. The box is lock out to the extend that only console access is allow. Worse of all, the regular password for the user name that I used to login for sysadmin stuff, have been "forgotten" as well too. Too Bad...
Anyway, as long as the physical box can be access, no security measures is good enough to stop the box being compromise. :P
This box is running the superior FreeBSD OS. The root password can be reset by :
But things happen. Today, I've totally forgotten root password. The box is lock out to the extend that only console access is allow. Worse of all, the regular password for the user name that I used to login for sysadmin stuff, have been "forgotten" as well too. Too Bad...
Anyway, as long as the physical box can be access, no security measures is good enough to stop the box being compromise. :P
This box is running the superior FreeBSD OS. The root password can be reset by :
2010-06-24
FreeBSD - How to format & partition additional hard disk
While housekeeping the external hard disk laying around, I managed to squeeze out one spare hard disk out of this cleaning practice. The size is big enough to act as a backup media for my FreeBSD server & desktop workstations. The external hard disk partition layout preferred would be 3 partitions. The 1st (backup of OS & data) & 2nd partition (data backup) will be FreeBSD UFS & the 3rd will be FAT32 (for media transfer).
Since my workstation doesn't support FreeBSD UFS file system, I'll partition & format it using the FreeBSD server. All tools involve are command line utilities and can be done through remote secure shell. This post can also be serve as a guide for adding new/used additional hard disk to FreeBSD server.
Here goes :
Since my workstation doesn't support FreeBSD UFS file system, I'll partition & format it using the FreeBSD server. All tools involve are command line utilities and can be done through remote secure shell. This post can also be serve as a guide for adding new/used additional hard disk to FreeBSD server.
Here goes :
2010-01-14
FreeBSD - How to manage ports in FreeBSD using portmanager
There are various way of managing ports, using utilities. The usual "cd /usr/ports/<ports directory>; make; make install; make clean", portmaster, portupgrade and others. Today, this post will brief on how to use portmanager to install, upgrade and delete ports.
Using portmanager to manage ports have a few advantage :
Using portmanager to manage ports have a few advantage :
- portmanager scans for what dependencies are needed and then determine what needed to be upgrade or install in order to fulfill the dependencies. At this stage, the dependencies are identified install/upgrade which is good as other utilities tends to fail in the mid of the installation just because some ports are too old or cannot install.
- portmanager supports output its messages to a log file. This is especially useful for trouble shooting what port / dependencies are giving problem.
- portmanager is also able to backup the current port/dependency before installing the new port. This useful when the new port cannot be install or interrupted during the installation, resulted a state where new port fail to install and new port have been deleted.
- portmanager collects its data by scanning the ports tree rather then building an index for the installed ports and depend on it. This is very less likely to cause problem as indexes are tend to be corrupted when abruptly (Ctrl-C) stopping installation in the halfway.
- portmanager gives a summary when installing dependencies/port. This gives an idea how many ports needs to be install or upgrade. This also means how much caffeine needed :p
2010-01-12
FreeBSD - How to setup ports using wget to download
The default download program for ports is using fetch. fetch is fine but my personal preference is wget. wget uses 1 connection to download, unlike my previous post that mentioned "Download ports simultaneously with multiple connections".
But wget gives extra bell and whistle like date/time of the download, log to file, continue from a partially downloaded file, rate limit of the download & others.
The below is how to setup ports to use wget to download :
But wget gives extra bell and whistle like date/time of the download, log to file, continue from a partially downloaded file, rate limit of the download & others.
The below is how to setup ports to use wget to download :
2010-01-11
FreeBSD - Tips to prepare large ports installation
Ports gets it's sources from internet. If the sources is big or there are multiple tens of sources, the tendency to fail in the mid of the ports installation increases.
Scenario 1:
Bumpy internet broadband internet connection, like mine, will disconnect halfway when downloading big files (> 10 MB)
Scenario 2:
Large ports that depends on tens if not hundreds of other ports. e.g. KDE4 or other window manager.
Scenario 3:
Limited online time frame and will need to take the machine off line after a period of internet usage.
Scenario 4:
Need to download the sources so that it can be moved to another box for compilation. A box that does not have reasonable or slow internet bandwidth to download.
Often, the above scenario are stuck with me, unfortunately. But the fortunate part is, while meddling with ports, a few steps can be taken to reduce the chances of these hiccups.
For illustration purpose, we'll use installation of KDE4 (the excellent Desktop environment) as an example. KDE4 depends on hundreds of other ports. The download of the sources alone will take some time and this serve as a good example. Here are the steps :
Scenario 1:
Bumpy internet broadband internet connection, like mine, will disconnect halfway when downloading big files (> 10 MB)
Scenario 2:
Large ports that depends on tens if not hundreds of other ports. e.g. KDE4 or other window manager.
Scenario 3:
Limited online time frame and will need to take the machine off line after a period of internet usage.
Scenario 4:
Need to download the sources so that it can be moved to another box for compilation. A box that does not have reasonable or slow internet bandwidth to download.
Often, the above scenario are stuck with me, unfortunately. But the fortunate part is, while meddling with ports, a few steps can be taken to reduce the chances of these hiccups.
For illustration purpose, we'll use installation of KDE4 (the excellent Desktop environment) as an example. KDE4 depends on hundreds of other ports. The download of the sources alone will take some time and this serve as a good example. Here are the steps :
2010-01-08
FreeBSD - Ports is fetching from slow servers
Ports randomly gets it's source server list from /usr/ports/Mk/bsd.sites.mk, as defined by the port maintainer. But the top 1st choice of the list may not be the one physically near to us and thus the download speed is much desirable. Most of the time compiling ports doesn't necessary takes a long time (like my 3 years AMD athlon 1.8Ghz perform fairly good). In fact, downloading of the sources is the one that takes a long time.
In this case, we'll need to tune the ports so that it fetches the sources from the nearest (physically) server. A nearer server normally means less latency and less latency means faster connection (this may not be the whole truth but truth is in it. :p)
The port "fastest_sites" will test the latency of the server listed in /usr/ports/Mk/bsd.sites.mk and output to a file. The file is suitable to be included in /etc/make.conf which tell ports where to fetch the sources from.
Here it is how to:
In this case, we'll need to tune the ports so that it fetches the sources from the nearest (physically) server. A nearer server normally means less latency and less latency means faster connection (this may not be the whole truth but truth is in it. :p)
The port "fastest_sites" will test the latency of the server listed in /usr/ports/Mk/bsd.sites.mk and output to a file. The file is suitable to be included in /etc/make.conf which tell ports where to fetch the sources from.
Here it is how to:
2010-01-06
FreeBSD - Compilation errors on port KDE4 in FreeBSD 8.0
While adding GUI Desktop environment into my development box, an error encountered when compiling KDE4, the stable and nice looking Desktop environment. Compiling KDE4 can take quite some time as it depends on few hundred other ports. Alternatively, you can install KDE4 from the packages by using the command :
But installing programs using ports is always my preference. Although ports takes additional time to compile but the flexibility to configure what options to enable or disable is preferred. By using ports, it also allows us to search (make quicksearch name=port-name) the local repository (/usr/ports) on what other related programs we can have.
Back to the topic. Halfway ports compiling KDE4, it halted with an error compiling the port "kdebase-runtime-4.3.4". Instead of searching the errors in a one big whole of logs, manually compile /usr/ports/x11/kdebase4-runtime to zoom in the error. Below is what the ports complained about while installing /usr/ports/x11/kdebase4-runtime (which is part of the dependencies of KDE4) :
From the errors, it seems kdepimlibs4 is missing of a dependencies related to "boost::python".
pkg_add -r kde4
But installing programs using ports is always my preference. Although ports takes additional time to compile but the flexibility to configure what options to enable or disable is preferred. By using ports, it also allows us to search (make quicksearch name=port-name) the local repository (/usr/ports) on what other related programs we can have.
Back to the topic. Halfway ports compiling KDE4, it halted with an error compiling the port "kdebase-runtime-4.3.4". Instead of searching the errors in a one big whole of logs, manually compile /usr/ports/x11/kdebase4-runtime to zoom in the error. Below is what the ports complained about while installing /usr/ports/x11/kdebase4-runtime (which is part of the dependencies of KDE4) :
[ 2%] Built target kcm_mailtransport_automoc [ 2%] Built target mailtransport_automoc [ 2%] Built target microblog_automoc [ 2%] Built target kpimtextedit_automoc [ 2%] Built target syndication_automoc Scanning dependencies of target gpgmepp [ 2%] Building CXX object gpgme++/CMakeFiles/gpgmepp.dir/gpgmepp_automoc.o Linking CXX shared library ../lib/libgpgme++.so [ 7%] Built target gpgmepp Scanning dependencies of target gpgmepp-pthread [ 7%] Building CXX object gpgme++/CMakeFiles/gpgmepp-pthread.dir/gpgmepp-pthread_automoc.o Linking CXX shared library ../lib/libgpgme++-pthread.so [ 11%] Built target gpgmepp-pthread [ 11%] Building CXX object akonadi/CMakeFiles/akonadi-kde.dir/itemserializer.o In file included from /usr/local/include/boost/parameter/aux_/arg_list.hpp:14, from /usr/local/include/boost/parameter/aux_/tagged_argument.hpp:10, from /usr/local/include/boost/parameter/aux_/tag.hpp:8, from /usr/local/include/boost/parameter/keyword.hpp:10, from /usr/local/include/boost/parameter/name.hpp:8, from /usr/local/include/boost/graph/named_function_params.hpp:15, from /usr/local/include/boost/graph/depth_first_search.hpp:21, from /usr/local/include/boost/graph/topological_sort.hpp:16, from /usr/ports/deskutils/kdepimlibs4/work/kdepimlibs-4.3.4/akonadi/itemserializer.cpp:40: /usr/local/include/boost/parameter/aux_/maybe.hpp:13:53: error: boost/python/detail/referent_storage.hpp: No such file or directory In file included from /usr/local/include/boost/parameter/aux_/arg_list.hpp:14, from /usr/local/include/boost/parameter/aux_/tagged_argument.hpp:10, from /usr/local/include/boost/parameter/aux_/tag.hpp:8, from /usr/local/include/boost/parameter/keyword.hpp:10, from /usr/local/include/boost/parameter/name.hpp:8, from /usr/local/include/boost/graph/named_function_params.hpp:15, from /usr/local/include/boost/graph/depth_first_search.hpp:21, from /usr/local/include/boost/graph/topological_sort.hpp:16, from /usr/ports/deskutils/kdepimlibs4/work/kdepimlibs-4.3.4/akonadi/itemserializer.cpp:40: /usr/local/include/boost/parameter/aux_/maybe.hpp:90: error: 'boost::python' has not been declared /usr/local/include/boost/parameter/aux_/maybe.hpp:90: error: expected unqualified-id before '<' token /usr/local/include/boost/parameter/aux_/maybe.hpp: In member function 'typename boost::add_reference::type>::type boost::parameter::aux::maybe::construct2(const U&) const': /usr/local/include/boost/parameter/aux_/maybe.hpp:59: error: 'm_storage' was not declared in this scope /usr/local/include/boost/parameter/aux_/maybe.hpp: In member function 'void boost::parameter::aux::maybe::destroy()': /usr/local/include/boost/parameter/aux_/maybe.hpp:72: error: 'm_storage' was not declared in this scope *** Error code 1 1 error *** Error code 2 1 error *** Error code 2 1 error *** Error code 1 Stop in /usr/ports/deskutils/kdepimlibs4.
From the errors, it seems kdepimlibs4 is missing of a dependencies related to "boost::python".
2010-01-05
FreeBSD - How to check swap space or partition info
Use the command :
Specified the parameter "-h" to convert the bytes to "h"uman readable form :
Sayonara !!!
swapinfo
Specified the parameter "-h" to convert the bytes to "h"uman readable form :
swapinfo -h
Sayonara !!!
2009-12-31
FreeBSD - Known Vulnerabilities audit check on FreeBSD Ports
The FreeBSD Ports repository have a rich base of software. As of today, it has 21000 ++ ports. As we all know, all software have bugs. Some bugs leads to vulnerabilities. Vulnerabilities opens door to unwanted access, at least not to those have ill intentions.
Every now and then, FreeBSD sysadm tends to install or upgrade new ports. As such, we should be more aware of what bugs or vulnerabilities that comes with it. Even we may not be able to fix it, but at least we should be aware of it so that we can find alternatives to secure it.
For ports, there is a utility to check on what vulnerabilities have been reported on it. Here is how to install and update it frequently :
Every now and then, FreeBSD sysadm tends to install or upgrade new ports. As such, we should be more aware of what bugs or vulnerabilities that comes with it. Even we may not be able to fix it, but at least we should be aware of it so that we can find alternatives to secure it.
For ports, there is a utility to check on what vulnerabilities have been reported on it. Here is how to install and update it frequently :
2009-10-01
FreeBSD - For the love of all
For the love of the world, please do this.
Step 1 :cd /usr/srcStep 2 :
make love
Enjoy the output :)
World Peace !!!
2009-09-30
FreeBSD - Download ports simultaneously with multiple connections
By default, ports uses 1 connection to download and thus unbearably slow when a server rate limit the connection. Alternatively, we can tell ports to use external utility in order to open multiple connections and download simultaneously.
2009-08-30
FreeBSD - How to use Meta Ports to install group of ports
Often, after a fresh new installation of FreeBSD, we have a set of programs we want to install. The conventional method would be installing it one by one in /usr/ports. Today, we will use meta ports to install the set of applications by just one "make install clean" rather then "cd" into individual directories and do "make install clean" for every ports.
Meta ports are, as the name implies, ports file that describe about the program we are installing. The ports file describe where & what to install for this ports to work. A sample of "where" would be "where to download the source", "where to install it" and so on. As for "what", it would be "what to install to fulfill the dependencies". In this post, we will take advantage of this "what". We will define the dependencies as the list of programs we want to install so that the ports will install it.
This is an example of how to do it :
Meta ports are, as the name implies, ports file that describe about the program we are installing. The ports file describe where & what to install for this ports to work. A sample of "where" would be "where to download the source", "where to install it" and so on. As for "what", it would be "what to install to fulfill the dependencies". In this post, we will take advantage of this "what". We will define the dependencies as the list of programs we want to install so that the ports will install it.
This is an example of how to do it :
2009-08-11
FreeBSD - Quick install guide (aka How to install FreeBSD)
Much great have been said on FreeBSD;
Even though some of the above might scare off a normal user, no doubt it is still a great OS that no others can beat. Don't believe me? Try it yourself with the below few pictures (to guide) :
- the license has all the freedom you need
- server apps setup are mostly manual. no wizard of oz, no gui. Which makes the administrator have control over everything.
- it boots faster
- its stability is like rock, hard to crash :)
- default installation are lean and mean. Is meant to be built from scratch. Ain't no rubbish you want on the system to trade for vulnerabilities.
Even though some of the above might scare off a normal user, no doubt it is still a great OS that no others can beat. Don't believe me? Try it yourself with the below few pictures (to guide) :
2009-07-23
FreeBSD - Error installing KDE4 or Xine
Halfway through installing KDE4 or any ports that is related to Xine, ended fail with the below error message :
It seems that the patching for ffmpeg in libxine fail for some reason. Checking out the freebsd.org bugs database, it is due to ffmpeg in libxine does not need that patch. The solution to it is :
===> Found saved configuration for libxine-1.1.16.3_1 => xine-lib-1.1.16.3.tar.bz2 doesn't seem to exist in /usr/ports/distfiles/. => Attempting to fetch from http://superb-east.dl.sourceforge.net/sourceforge/xine/. xine-lib-1.1.16.3.tar.bz2 100% of 7293 kB 232 kBps 00m00s ===> Extracting for libxine-1.1.16.3_1 => MD5 Checksum OK for xine-lib-1.1.16.3.tar.bz2. => SHA256 Checksum OK for xine-lib-1.1.16.3.tar.bz2. ===> libxine-1.1.16.3_1 depends on file: /usr/local/bin/perl5.8.9 - found ===> Patching for libxine-1.1.16.3_1 ===> libxine-1.1.16.3_1 depends on file: /usr/local/bin/perl5.8.9 - found ===> Applying FreeBSD patches for libxine-1.1.16.3_1 1 out of 1 hunks failed--saving rejects to src/combined/ffmpeg/Makefile.in.rej => Patch patch-src_combined_ffmpeg_Makefile.in failed to apply cleanly. => Patch(es) patch-config.rpath patch-configure patch-misc_Makefile.in patch-misc_libxine.pc.in patch-src:libffmpeg:libavcodec:h263.c patch-src:libffmpeg:libavcodec:mpeg12.c patch-src:libffmpeg:libavcodec:msmpeg4.c patch-src:xine-engine:xine_internal.h patch-src_audio_out_audio_oss_out.c applied cleanly. *** Error code 1 Stop in /usr/ports/multimedia/libxine. *** Error code 1
It seems that the patching for ffmpeg in libxine fail for some reason. Checking out the freebsd.org bugs database, it is due to ffmpeg in libxine does not need that patch. The solution to it is :
2009-07-20
FreeBSD - How to install flash plugin or player to work with FireFox
This post is part of the "How to install FreeBSD as your Desktop" series and it shows how to install flash plugin onto FireFox internet browser in FreeBSD. Here it is :
2009-07-19
Freebsd - How to install FreeBSD as your Desktop
UPDATE : After testing PC-BSD for a while (more then 6 months), PC-BSD indeed is a FreeBSD variant that is superior in Desktop environment. Its user friendly installation and configuration have make FreeBSD so much more suitable running as an Desktop. Unless you're interested in figuring out how to tweak and turn FreeBSD to work in a Desktop, give PC-BSD a try, you'll love it!
Check it out at PC-BSD website !!!
PsyberMonkey is turning his desktop to FreeBSD and this is the work he has done :-
1. FreeBSD quick install guide (aka How to install FreeBSD).
2. make sure hardware are detected properly
3. Using ports to install software - go to Section III.
4. Getting KDE, GNOME and XFCE up and running (how to still in progress)
Other miscellaneous stuff :
This post will be updated periodically to reflect the progress of using FreeBSD as a Desktop.
Adios !!!
Check it out at PC-BSD website !!!
PsyberMonkey is turning his desktop to FreeBSD and this is the work he has done :-
1. FreeBSD quick install guide (aka How to install FreeBSD).
2. make sure hardware are detected properly
- How to install or add sound card driver module
- wireless (how to still in progress)
- ACPI (still having trouble making it work)
- remote control through SSH (how to still in progress)
- all others e.g. external drive formatted in FAT32, display card, track pad, external mouse, gigabit network card & etc are detected and function properly.
3. Using ports to install software - go to Section III.
4. Getting KDE, GNOME and XFCE up and running (how to still in progress)
Other miscellaneous stuff :
- How to disable or turn off the keyboard beep sound
- How to assign or remove fixed IP
- IP address automatically assign aka DHCP
- How to install flash plugin or player to work with FireFox
- Backup & restore for disaster recovery
- How to upgrade the kernel or base system
- Error installing KDE4 or Xine
This post will be updated periodically to reflect the progress of using FreeBSD as a Desktop.
Adios !!!
Subscribe to:
Posts (Atom)
