# [howto] Minimal FreeBSD desktop



## taz (Oct 23, 2012)

*Table of contents*
*---[ Intro*
*---[ Desktop usage on FreeBSD*
*---[ Objective*
*---[ Getting started - ports and packages*
*---[ Xorg and basic desktop*
*------[ Xorg*
*------[ Window manager*
*------[ Panel*
*------[ Launching applications*
*------[ Setting wallpaper and viewing images*
*------[ Terminal emulator*
*------[ Auto mounting*
*------[ Starting X*
*---[ Userland applications*
*------[ Browser*
*------[ Editor/IDE*
*------[ File Manager*
*------[ Video and audio player*
*------[ PDF Reader*
*------[ Torrent client*
*------[ Wireless network manager*
*------[ Network file sharing*
*------[ VirtualBox*
*---[ Misc *
*---[ Outro*


*---[ Intro*

Three years back I was starting to become seriously unhappy with Windows and started to look for an alternative. My biggest problems were the fact that I did not have full control over my OS, closed source philosophy and "millions" of applications/libraries I did not want to have on my system.

The choice came down to FreeBSD and GNU/Linux. After browsing the Internet for a weak or so I decided to go with FreeBSD because I wanted a UNIX system and back then FreeBSD seemed to be "more of a pure UNIX" then Linux.

Nowadays I use FreeBSD because of these reasons:


FreeBSD flows the UNIX philosophy: "Write programs that do one thing and do it well"
FreeBSD is almost fully POSIX compliant
FreeBSD code is clean
FreeBSD Handbook
FreeBSD gets the job done.
FreeBSD is virus free.
BSD license
...and so much more but these are the highlights.

The focus of this "howto" is desktop usage on FreeBSD but I would just like to say that three years back FreeBSD was an "alternative" for me and now everything else is the "alternative".
Also I would like to say thanks to FreeBSD developers for creating such a beautiful piece of software.

*---[ Desktop usage on FreeBSD*

After deciding that FreeBSD was going to be my new primary OS the question was "how to set it up for desktop usage?". FreeBSD handbook helped me with this a lot in the beginning. But if you follow the handbook you will probably end up with GNOME or KDE desktop environment and this "how to" is about minimal but functional desktop on FreeBSD.

Fact is that FreeBSD is more than capable of being a desktop OS the only question is what are your own preferences/requests. Mine were: minimalism, functionality, speed, low memory footprint and avoiding linuxisms.

In general, if you want to use FreeBSD as a desktop you have two ways of doing that:

1) installing a desktop environment (DE) like x11/gnome2, x11/kde4, x11-wm/xfce4, x11-wm/enlightenment , x11/lxde-meta

I have been down this road when I first started and I was not happy. I ended up with the same problem I had on Windows. Bunch of applications I did not use, high memory footprint , eye candy that has no functionality apart from eating memory for no good reason, etc.

I have actually tried all of these ports and the only one that comes into consideration IMHO, as far as minimalism goes, is x11/lxde-meta. But this "how to" is not about DE so I will not go any further into this option.

2) building your desktop from ground up with ports your only want

Now we are in business. IMHO this path is the "true" path because you will have a fully functional desktop set up the way YOU want it and you will gain so much experience and knowledge that would be simply skipped with the first path.

Do not get me wrong, althoughgh this is the "true" path it is not the easy one. It took me a lot of time to figure things out and to set up my desktop just the way I want it. I have installed and reinstalled FreeBSD so many times because I was experimenting with different ports. Now I have a shell script that installs and sets up my desktop with almost zero human interaction.

This "how to" is so that you would not need to experiment as much as I did (but you will have to experiment to a certain degree). I will present my findings over the years, ports I have settled on and alternatives to thees ports, useful readings and so on. By the end of this "howto" a FreeBSD newcomer should get the general idea of what it means and what is necessary to set up a desktop from grand up.

I will assume that you have in fact successfully installed FreeBSD and you just logged in for the first time with you user name.

If you are looking for some help on how to install FreeBSD refer to the handbook's section Installing FreeBSD 9.X and Later.

Reading the whole Getting Started section in the handbook is a MUST and I will assume that you have read it. Do not install anything but read it.

*---[ Objective*

Apart from preferences I have mentioned before we will try to avoid as much as possible the following things:


ports that require lots of dependency's
ports that depend on x11-toolkits/gtk20
ports that depend on devel/qt4

and depending on your choices for certain ports it is possible to build a "pure CLI" desktop without x11-toolkits/gtk20 or devel/qt4.

At the end we will be able to:


browse the internet
manage our files and folders with a file manager
edit our files with an editor
play movies and music
download torrents
auto mount USB drives (including NTFS formatted drives with read/write operations)
read pdf files
view images
manage our wireless connection
share files with FreeBSD/Linux/Windows
emulate another OS for anything else we do not want to/can not have on our FreeBSD system but is needed.

What more do you need, eh? 

*---[ Getting started - ports and packages*

Assuming you have read the handbook's section on ports and packages I am just going to say that we are going to use ports and compile everything from source. Reason is that we need to be able to "turn off" features and that can not be accomplished via packages since they are precompiled.

Before anything we need to update our ports tree so run this commands if you don't have the ports tree installed:

`# portsnap fetch`
`# portsnap extract`
`# portsnap update`

run this command later on when you wish to update the installed ports tree:

`# portsnap fetch update`

Now we need to decide how are we going to manage our ports. ports-mgmt/portmaster is a great tool that dose not require external databases or languages so we will use that.

Install the port:

`# cd /usr/ports/ports-mgmt/portmaster/ && make install clean`

Sample configuration file for portmaster si located at /usr/local/etc/portmaster.rc.sample. Copy it to /usr/local/etc/portmaster.rc and set the options you like:

`# cp /usr/local/etc/portmaster.rc.sample /usr/local/etc/portmaster.rc`
`# ee /usr/local/etc/portmaster.rc`

ee(1) stands for "easy editor" and comes with FreeBSD. It is very simple to use and perfect for editing configuration files form command line. Another option would be VI(1) if you are familiar with it.

I have enabled thees options but for more information you can refer to the man page PORTMASTER(8)


----------



## taz (Oct 23, 2012)

```
# Always delete stale distfiles without prompting (-d)
ALWAYS_SCRUB_DISTFILES=dopt
# Be verbose (-v)
PM_VERBOSE=vopt
# Install packages for build-only dependencies (--packages-build)
PM_PACKAGES_BUILD=pmp_build
# Delete build-only dependencies when finished (--delete-build-only)
PM_DEL_BUILD_ONLY=pm_dbo
#Suppress the build confirmation message (--no-confirm)
PM_NO_CONFIRM=pm_no_confirm
```

From now on we will use portmaster for managing ports.

And here are some commands you might find useful:


```
upadate all ports:

	portmaster -a 
	force:
		portmaster -af
	
search for updates and list all installed ports by category:
		
	portmaster -L
	portmaster -L | grep "New version available:"
		
clean stale distfiles:

	portmaster --clean-distfiles
	with out promt:
		portmaster --clean-distfiles-all
	
uninstall the port and it's dependencies:
	
	portmaster -e target_port

rebuild the specified port, and all ports that depend on it:
	
	portmaster -r target_port
```

*---[ Xorg and basic desktop*

*Xorg*

x11/xorg is a meta port for all the X.Org ports but we will install just the ones we need. You could just install the meta port and it would not make much of a difference but I like perfection so things like this get to me . There is also x11/xorg-minimal and you can also use that too instead of compiling individual ports.

First install x11-servers/xorg-server:

`# portmaster x11-servers/xorg-server`

*Important: disable HAL option!*

sysutils/hal is usually used for auto mounting but we will use FreeBSD's DEVD(8) since hal is linuxisms.

Also disable hal in all other ports that might have HAL option.

Next install x11-drivers/xorg-drivers for mouse, keyboard and your video card:

`# portmaster x11-drivers/xorg-drivers`

Make sure MOUSE and KEYBOARD options are selected and select the video driver for your video card. You might also want to select VESA option just in case. Disable every thing else.
If you have an nvidia card use this port for video drivers instead of Xorg's: x11/nvidia-driver. But make sure you disable LINUX option for this port and all others that might have such an option.

Next install x11/xinit, x11/xauth, x11-fonts/xorg-fonts and x11-fonts/webfonts

`# portmaster x11/xinit`
`# portmaster x11/xauth`
`# portmaster x11-fonts/xorg-fonts`
`# portmaster x11-fonts/webfonts`

Next we need to configure Xorg so run this command:

`# Xorg -configure`

This will create a new configuration file which needs to be copied to Xorg folder:

`# cp /root/xorg.conf.new /etc/X11/xorg.conf`

Edit the file to set your keyboard layout and resolution. For keyboard layout add " Option "XkbLayout" "<your_layout>" " line to "InputDevice" section:


```
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbLayout" "hr"
EndSection
```

And for resolution add "Modes "1366x768"" line to "Screen" section. If you have multiple depth's just delete them and leave the "Depth 24".


```
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1366x768"
EndSubSection
EndSection
```

If you are using nvidia-driver install x11/nvidia-xconfig:

`# portmaster x11/nvidia-xconfig`

and run:

`# nvidia-xconfig`
`# echo "nvidia_load=\"YES\"" >> /boot/loader.conf`

This will create a new xorg.conf file or edit an existing one. The second command will load nvidia-driver kernel module at start up.

And finally enable MOUSED(8) for mouse support.

`# echo "moused_port=\"/dev/psm0\"" >> /etc/rc.conf`
`# echo "moused_enable=\"YES\"" >> /etc/rc.conf`

We could now reboot and start our first Xorg session but there is not much of a point since we do not have anything else installed so we are proceeding to window managers.

*Window manager*

This is where experimenting starts. There are many window managers (WM) and finding the one that suits your needs can be time consuming. I will list the ones that are most commonly used and how to setup the one I personally use.

The first window manager I tred was x11-wm/fluxbox but swiched to x11-wm/openbox because openbox is written in C where fluxbox is written in C++ and because with openbox you just get a window manager where with fluxbox you get a window manager and a built in panel which I did not like. Openbox is configured via xml syntax which might be a little confusing but once you configure it you most likely won't need to change it ever again.

If you do not like openbox there are plenty of other windows managers out there. I will list here the ones that people seam to be using the most but trust me there are PLENTY of others.

Here is a list of most common ones:

x11-wm/openbox
x11-wm/fluxbox
x11-wm/dwm
x11-wm/twm
x11-wm/windowmaker
x11-wm/fvwm
x11-wm/ratpoison
x11-wm/icewm
x11-wm/awesome, this is a a tiling window manager which means non-overlapping frames.
x11-wm/spectrwm, another tiling wm

Now lets setup the one I use and that would be x11-wm/openbox.

First install the port:

`# portmaster x11-wm/openbox`

Next is configuration (make sure you are not executing thees commands as root):

`$ mkdir ~/.config`
`$ mkdir ~/.config/openbox`
`$ cp /usr/local/etc/xdg/openbox/menu.xml ~/.config/openbox/menu.xml`
`$ cp /usr/local/etc/xdg/openbox/rc.xml ~/.config/openbox/rc.xml`
`$ touch ~/.config/openbox/autostart.sh && chmod +x ~/.config/openbox/autostart.sh`
`$ echo "#!/bin/sh" >> ~/.config/openbox/autostart.sh`

This will create the openbox configuration folder for your account and copy configuration files to it. 
~/.config/openbox/autostart.sh is a script that will be executed every time you start openbox. 
~/.config/openbox/menu.xml is the configuration file for openbox menu which will be visible when you press the right mouse button on the desktop.
~/.config/openbox/rc.xml is the configuration file for openbox itself. 

For now we will leave it at default settings but further information on configuring openbox can be found here.

Finlay we need to tell Xorg to use openbox:

`$ echo "exec openbox-session" >> ~/.xinitrc`

*Panel*

The window manager will take care of our windows but we need some place to hold them when we minimize our windows and I will present two panels. One depends on gtk and the other one dose not. 

First one is x11/tint and it depends on gtk.

Install the port (and make sure you disable PYCONF option):

`# portmaster x11/tint`

Configuration:

`$ echo "(sleep 2 && tint2) &" >> ~/.config/openbox/autostart.sh`
`$ mkdir ~/.config/tint2`
`$ cp /usr/local/share/examples/tint2/tint2rc ~/.config/tint2/tint2rc`

This will launch tint when openbox starts and copy the example configuration file to home directory. Later on you can edit that file to suit your needs. How to do that is explained here.

If you are using openbox find these lines in the ~/.config/openbox/rc.xml file:


```
<margins>
<top>0</top>
<bottom>30</bottom>
<left>0</left>
<right>0</right>
</margins>
```

Bottom height should be the same as tint's height, not 0. This will prevent windows to overlap tint when maximized.

Second one is deskutils/pypanel and it dose not depend on gtk nor qt.

Install the port:

`# portmaster deskutils/pypanel`

Configuration:

`$ echo "(sleep 2 && pypanel) &" >> ~/.config/openbox/autostart.sh`

This will launch pypanel when openbox starts and the first time pypanel is launched it will create a default configuration file ~/.pypanelrc. Later on you can edit that file to suit your needs. The configuration file is well commented and configuration is fairly straightforward.

You might want to change the button event handler a little bit, though.

Find this lines:

```
if button == 1:
pp.taskFocus(task)
```

and put this:

```
if button == 1:
pp.taskFocus(task)
pp.taskFocus(task)
```

this will maximize the window and put focus on it with one mouse click.


----------



## taz (Oct 23, 2012)

*Launching applications*

We already have the possibility of launching applications via openbox's menu but I like to use a quick launch bar for this task. x11/wbar is a light quick launch bar and looks really slick. It depends on gtk though, so you might want to skip this part and configure ~/.config/openbox/menu.xml file for quick launch. Also pypanel has a built in appliation launcher.

Install the port (and make sure you disable WBARCONFIG option):

`# portmaster x11/wbar`

Configuration:

Start wbar on openbox startup:

`$ echo "(sleep 2 && wbar) &" >> ~/.config/openbox/autostart.sh`

This will launch wbar when openbox starts and the first time wbar is launched it will create a default configuration file ~/.wbar. Later on you can edit that file to suit your needs. Configuration is fairly straightforward. You just have to specify the path to icon, command and text to be displayed.

Example:

```
i: /usr/local/share/pixmaps/wbar/terminal.png
c: urxvtc 
t: urxvtc

i: /usr/local/share/pixmaps/wbar/music.png
c: urxvt -e mplayer -playlist ~/tera1/Music/RadioStream/soulful.pls
t: soulful
```

A nice trick with launching terminal based applications is the terminals "-e" option. With it you can launch a terminal window and make it to immediately run a command specified behind the "-e" switch. That way you don't have to first launch the terminal and then type in the command.

*Setting wallpaper and viewing images*

For viewing images I have chosen graphics/feh and we can use it to set wallpaper to, which is neat.

Install the port:

`# portmaster graphics/feh`

Configuration:

`$ echo "feh --bg-scale ~/path/to/wallpaper.jpg &" >> ~/.config/openbox/autostart.sh`

This will set the wallpaper each time you start openbox. You probably don't have any pictures yet on your system so you can FETCH(1) this nice FreeBSD wallpaper and set it up.

`$ cd ~/.config/openbox/`
`$ fetch [url]http://www.bsdnexus.com/wallpapers/DD_freebsd.jpg[/url]`
`$ echo "feh --bg-scale DD_freebsd.jpg &" >> autostart.sh`

And if you want to view images just run feh form the command line and make sure you are positioned in the folder you want to view images:

`$ feh -t`

Extra reading can be found here.

*Terminal emulator*

Choosing the right terminal emulator is really important since you will be spending a lot of time using it. So you want to choose the one you are comfortable with. I will list the ones I have tried, reasons why I switched to another one and explain how to setup the one I settled with.

These are the one I have tried:

x11/sterm -> single binary, simple and minimal, no tabs.
x11/xterm -> used it for a long time but it has no support for tabs
x11/roxterm -> depends on gtk
x11/aterm
x11/eterm
x11/rxvt-unicode -> the one I use

x11/rxvt-unicode is realy neat. It supports tabs via perl extension, stores text in unicode, has transparency if you want that slick look, configurable via ~/.Xdefaults file, lightweight, fast, deamon/client mod and most importantly it just works.

So if you want to try x11/rxvt-unicode here s how you set it up.

Install the port (default options are ok):

`# portmaster x11/rxvt-unicode`

Configuration:

Configuration is done via ~/.Xdefaults. Here is a nice reading on how to configure it.

I personally like the solarized colors so I have adapted this ~/.Xdefaults and and modified it to my needs.

I suggest running urxvt in deamon/client mode for faster performance and lower memoy footprint so run urxvtd at startup:

`$ echo "urxvtd -q -f -o" >> ~/.config/openbox/autostart.sh`

and then use:

`$ urxvtc`.

You can copy/paste via middle mouse button. Just select the text in terminal or other application and it will be "copied". To paste it, either to terminal or other application, press the middle button or both left and right mouse buttons simultaneously if you don't have a middle button.

A better solution is a perl plugin you can found here. You will need x11/xclip for it to work and the path for urxvt perl plugins on FreeBSD is /usr/local/lib/urxvt/perl/. How to set it up is described at the provided link.

If you don't want to use tabs to have multiple terminals in one window, take a look at sysutils/tmux which is a terminal multiplexer.

*Auto mounting*

As mentioned before we will not use hal but FreeBSD's DEVD(8) wich stand for "device state change daemon".

There is a script that wrapps around DEVD(8) and dose the mounting for us: sysutils/automount.

Install the port:

`# portmaster sysutils/automount`

Configuration is done via /usr/local/etc/automount.conf and you can run this command to see what options you have:

`$ automount --help`

I just use this option in my /usr/local/etc/automount.conf file:

```
REMOVEDIRS="YES"
```

If you want to mount NTFS formatted drives with read/write operations you will need to install sysutils/fusefs-ntfs.

Install the port:

`# portmaster sysutils/fusefs-ntfs`

Configuration:

`# cp /usr/local/modules/fuse.ko /boot/modules/`
`# echo "fuse_load=\"YES\"" >> /boot/loader.conf`

This will load the kernel module on start up and automount will recognise that you have installed fusefs-ntfs and will use it for NTFS formatted drives.

If you want to auto mount a IDE/SATA hard drive connected to your mother board check this thread out.

In case you are wondering how to use it by hand here is the command you can issue to mount NTFS drives:

`# ntfs-3g /dev/da*s1 /mnt`

Run this command to find out what number to repalce "*" with:

`# dmesg`

*Starting X*

Now we should be ready to start our first Xorg session. But first lets reboot the system:

`# shutdown -r now`

If you want to power down use this command:

`# shutdown -p now`

And if you want to be able to reboot or power down from openbox without being root you should add your user name to the operator group:

`# pw groupmod operator -m user_name`

Before we actually start Xorg make sure you can run your terminal emulator either from wbar or from openbox's menu! By now you should be able to know how to do that.

Once you have logged in with your user name run this command to start Xorg:

`$ startx`

If everything went well and you have chosen to use openbox with tint and wbar you should be seeing something like this:





If you are not seeing something like this that means something went wrong and you will have to fix the problems you have. My suggestion is to FIRST search google for answers and if that dose not work THEN post here for help.


----------



## taz (Oct 23, 2012)

*---[ Userland applications*

Now we will proceed to common applications used by a desktop user. And we will start with a browser.

*Browser*

By now you should know how to install ports so I will stop posting the install command. Also I hope you are able to run your virtual terminal from Xorg .

Back to our browser. There is realy only one option IF you want to avoid gtk and qt which would be www/opera. VIDEO option is enabled by default and leave it at that if you want HTML5 video support. With it you will be able to view, currently, some YouTube videos.

With opera we can avoid gtk and qt but opera dose not really follow the "do one thing and do it well" philosophy. Do not get me wrong I use opera and it's great. They release a package for FreeBSD systems and really care about FreeBSD users. But comes with a built in email client, torrent client, etc. 

Flash is currently supported on FreeBSD via Linux kernel module and we are trying to avoiding linuxisms remember . In my opinion HTML5 will overcome Flash so I'm sticking with opera and HTML5. But here is how you do it if Flash is a "deal breaker".

Another solution for Flash would be www/youtube_dl. You can use this simple script to stream YouTube (and other popular video streaming sites like Vimeo) videos (requiers mplayer but we will get to that):


```
#!/bin/sh
#usage: ./this_script.sh "url"

COOKIE_FILE=/var/tmp/youtube-dl-cookies.txt
mplayer -cookies -cookies-file ${COOKIE_FILE} $(youtube-dl -g --cookies ${COOKIE_FILE} $*)
```

Use this command to download the video:

`$ youtube-dl "http://www.youtube.com/watch?v={video_id}`

Other popular browser like www/firefox, www/chromium, www/seamonkey are also available.

If you don't care about gtk that much and want minimalism with security I would suggest you check out www/xombrero.

And if you don't care about JavaScript check out www/links and www/dillo2. You can run links in a terminal or if you enabled X11 option you can run it like this:

`$ links -g`

*Editor/IDE*

Ah editor...such an important segment on UNIX like systems. For me it comes down to two options. One depends on gtk and the other one dose not.

First is devel/geany and I absolutely love it. It's actually a small IDE and I use it for all of my programming projects. The other one is editors/vim and it's THE editor among UNIX like systems. Vim is console based and once you learn , yes learn, how to use it it can become a very powerful tool/editor/IDE.

If you are going to try vim and you don't want the gtk front end called gvim make sure you pass this to make:


```
WITH_X11_ONLY=YES
```

this will compile vim with out the gui front end but will enable some other useful X11 features like the clipboard so you can copy/paste from other windows.

example for portmaster:

`# portmaster -m WITH_X11_ONLY=YES editors/vim`

Configuration file is ~/.vimrc. Browse the Internet on how to setup vim but I suggest you start with this example vimrc file. 

I myself am in the process of completely switching to vim but I got so used to geany that it's not such a simple task.

I guess I should mention editors/emacs, but that is all I'm going to do.

*File Manager*

For a X11 based fm I suggest x11-fm/xfe. It dose not depend on gtk nor qt and it's awsome!

For a console based file manager I suggest misc/mc. You will have to get used to it, though.

Another option is to simply use your virtual terminal for file managing. This is what I do and I got quite used to it. Most of the time you just use cd, cp, rm, mv and mkdir commands anyway. And with a shell like shells/zsh and auto completion you can manage your files quite fast.

*Video and audio player*

For playing video multimedia/mplayer, IMHO, is the authority among UNIX like systems. If you don't want a gtk front end make sure you disable the GUI option.

To play video with mplayer use this command:

`$ mplayer /path/to/video/file/example.avi`

mplayer has lots of options and I strongly suggest you check out the documentation.

But here are the keys I use the most:

```
9 - volume -
0 - volume +
f - toggle full screen
p - pause/resume
q - quit
```

nvidia-driver users might want to take a look at this.

multimedia/vlc is also available and by default it will compile with a qt frontend. You can disable that option, if you don't want qt and enable the ncurses console interface.

You can play your audio with mplayer or vlc but if you want a separate port for that check out audio/moc for a console audio player. And multimedia/audacious for a Winamp like audio player with a gtk front end.

To run moc use this command:

`$ mocp`

*PDF Reader*

For a pdf reader I have choosen graphics/mupdf. It's quite lightweight and fast.

Another lightweight option would be graphics/xpdf.

*Torrent client*

For a console based torrent client net-p2p/rtorrent is an excellent choice.

Sample configuration file is /usr/local/share/examples/rtorrent/rtorrent.rc, copy it to ~/.rtorrent.rc

`$ cp /usr/local/share/examples/rtorrent/rtorrent.rc ~/.rtorrent.rc`

Configuration is fairly straight forward and here is a nice reading on how to do that.

For a torrent client that has a gtk or qt frontend check out transmission.

You could install net-p2p/transmission-daemon and set it up as a deamon which can then be acsessed via web browser or transmission-remote. I used to do that but that was more of a work around since net-p2p/rtorrent was missing some functionalities like magnet links.

Also, www/opera has a built in torrent client.

*Wireless network manager*

net-mgmt/wifimgr is a great tool for managing your wifi connections on your laptop but it depends on gtk. It's actualy just a front end for FreeBSD's WPA_SUPPLICANT(8) so technically you don't need it.

I really like it and was actually thinking of porting the code to an ncurses front end. That would be so sweet


----------



## taz (Oct 23, 2012)

*Network file sharing*

If you want to be able to share files between your FreeBSD system and FreeBSD/Linux/Windows net/samba36 is the answer.

I would suggest you disable all options expect for maybe IPV6 support. Because most likely you do not need them and if you do you will know what to enable.
After you have installed samba set the password for your user name:

`$ smbpasswd -a user_name`

With this user name and password you will authenticate yourself before accessing the share.

Now if you want to share something on your FreeBSD system create the samba configuration file (a template can be found here /usr/local/etc/smb.conf.default)

`# ee /usr/local/etc/smb.conf`

and put this in it:


```
[global]
workgroup = WORKGROUP
server string = FreeBSD Samba server
netbios name = server_name
security = user
encrypt passwords = yes
#hosts allow = 127.0.0.1 192.168.1.0/24
#hosts deny = 0.0.0.0/0
socket options = TCP_NODELAY
log level = 2
log file = /var/log/samba.log.%m
max log size = 50
debug timestamp = yes

[Media]
comment = Media Share Folder
path = /path/to/folder/you/want/to/share
read only = no
writeable = yes
```

Change the server_name and /path/to/folder/you/want/to/share to suit your needs.

If you want to access you share from a Windows machine enter this in the windows explore bar or run it via run: 

[CMD=]//server_name[/CMD]

If you want to mount a windows share to your FreeBSD system, where xxx.xxx.xxx.xxx is the local ip address of a Windows machine, use this:

`# mount_smbfs -I xxx.xxx.xxx.xxx -N "//user_name@pc_name/share_name" /mnt`

If you want to mount another samba share to your FreeBSD system use this:

`# mount_smbfs //user_name@server_name/share_name /mnt`

If you want to start the samba service at start up run this command:

`# echo "samba_enable=\"YES\"" >> /etc/rc.conf`

If not you can start/stop the service like this form the terminal:

`# service samba start`
`# service samba stop`

For every thing else pleas refer to documentation.

*VirtualBox*

emulators/virtualbox-ose is one of my favorite application and I am so happy that FreeBSD supports it. I don't really like dual boot because I not want to have another OS on my hardware. With virtualbox-ose I can run Windows as if it was an application and every thing I don't want to have on my FreeBSD system, but need it on occasions, I just dump into virtualbox-ose and therefore keeping my FreeBSD system clean.

One thing that was bothering me constantly was the fact that it uses a qt based front end. And trust me qt is FAT! Turns out you do not need the front end and you can display the VM without the qt front end. The answer is VBoxSDL. You can read more about it here but here is a quote from the website:


```
VBoxSDL is a simple graphical user interface (GUI) that lacks the nice point-and-click support which VirtualBox, our main GUI, provides.
```

Sweet! Just what we need for our minimal desktop. And trust me it works great!

When you install virtualbox-ose make sure you disable QT4 and NLS options.

Here you can find instructions on how to set up virtualbox on FreeBSD or just run thees commands and reboot the system after:

`# echo "vboxdrv_load=\"YES\"" >> /boot/loader.conf`
`# echo "vboxnet_enable=\"YES\"" >> /etc/rc.conf`
`# echo "devfs_system_ruleset=\"system\"" >> /etc/rc.conf`
`# echo "[system=10]" >> /etc/devfs.rules`
`# echo "add path 'usb/*' mode 0660 group operator" >> /etc/devfs.rules`

Creating a VM form the terminal is fairly simple, you just have to read the documentation. I'm going to post a script that creates a very basic VM and if you want to enable some options that are not enabled by the script refer to this documentation.

Here is the script:

```
#!/bin/sh

#-----------------------------------------------------------------------
#CONFIG
#-----------------------------------------------------------------------

#set dir for virtual hard disk image
hdPath=/usr/home/$USER/DATA/VBoxHD
#set virtual hard disk image in MB
hdSize=20480
#set virtual machine name
vmName="WinXp"
#set os type. Run "VBoxManage list ostypes" to list options,c/p under ID.
osType="WindowsXP"
#set path to guest ISO
guestISO="/usr/home/$USER/DATA/xp.iso"
#set RAM size
ramSize=1024
#set RAM size for GPU
gpuRamSize=128
#set network interface
nic="re0"

#create folder for virtual hard disk image
if [ ! -d $hdPath ]
then 
mkdir $hdPath
fi

#-----------------------------------------------------------------------
#CREATE
#-----------------------------------------------------------------------

#create a new virtual hard disk image.
VBoxManage createhd --filename $hdPath/$vmName.vdi --size $hdSize

#create a new XML virtual machine definition file
VBoxManage createvm --name $vmName --ostype $osType --register

#add an IDE controller with a DVD drive attached, and the install ISO inserted into the drive. Set "--medium none" to detach all.
VBoxManage storagectl $vmName --name "IDE Controller" --add ide
VBoxManage storageattach $vmName --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium $hdPath/$vmName.vdi
VBoxManage storageattach $vmName --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium $guestISO

#set boot order
VBoxManage modifyvm $vmName --boot1 dvd --boot2 disk --boot3 none --boot4 none

#set I/O APIC support
VBoxManage modifyvm $vmName --ioapic on

#set the amount of RAM
VBoxManage modifyvm $vmName --memory $ramSize

#set the amount of RAM for virtual graphics card
VBoxManage modifyvm $vmName --vram $gpuRamSize

#set network mode(briged,NAT...)
VBoxManage modifyvm $vmName --nic1 bridged --bridgeadapter1 $nic

#enable USB support
VBoxManage modifyvm $vmName --usb on

#enable sound
VBoxManage modifyvm $vmName --audio oss --audiocontroller ac97
```

Once you have created the VM, run it with this command:

`$ VBoxSDL --startvm VM_name --fullscreen`

Use "CRTL + F" to toggle full screen.

To get a list of all the VMs run this:

`$ VBoxManage list vms`

If you want the guest additions you can find them here. Download the .iso and mount it to your virtual dvd like this:

`$ VBoxManage storageattach $vmName --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium /path/to/iso/additions.iso`.

We have enabled USB support so if you want to "mount" your USB drives here is what you do: (and make sure the VM is running!)

Firts make sure that the drive is not mounted on FreeBSD and if it is umount it:

`# umount /dev/da*`

Now list the USB devices to get UUID:

`$ VBoxManage list usbhost`

And attach your USB drive to your VM:

`$ VBoxManage controlvm VM_name usbattach UUID`

*---[ Misc *

Mount CD/DVD

Since devd dosn't have an event about inserting and removing CD/DVD from the drive you can't automount with sysutils/automount. Instead we have to mount manually for now:

`# mount_cd9660 /dev/cd0 /mnt`

Screenshot

You can take a screenshot with imlib2 like this:

`$ imlib2_grab myBSD.png`

Or with graphics/scrot that utilizes imlib2 but has some extra options like delay.

Calculator

bc

Disable beep sound in terminal:

`# echo "hw.syscons.bell=0" >> /etc/sysctl.conf`

Set UTF-8:

Edit ~/.login_conf and put this in it:


```
me:\
	:charset=UTF-8:\
	:lang=en_US.UTF-8:
```

for "lang" run this command to list avilable languages:

`$ locale -a`

*---[ Outro*

I hope this "howto" will be useful to someone trying to accomplish the same thing as me and to other FreeBSD beginners trying to set up a desktop environment from ground up. Comments and suggestions are more then welcome.


----------



## france75006 (Oct 23, 2012)

Ehi Taz, thank you very much! This is surely the most complete A to Z howto about a FreeBSD desktop machine I've ever read.


----------



## bbzz (Oct 23, 2012)

Nice taz!


----------



## taz (Oct 24, 2012)

Thank you for the positive feedback!Really appreciate it...


----------



## htutt (Oct 24, 2012)

Thanks for nice sharing!!


----------



## SirDice (Oct 24, 2012)

Instead of x11/xorg or installing individual parts you could also use x11/xorg-minimal.


----------



## taz (Oct 24, 2012)

True, but you get x11-drivers/xf86-video-vesa with  x11/xorg-minimal and I don't use VESA drivers.


----------



## Deleted member 30996 (Oct 24, 2012)

Very nice, well thought out.


----------



## Beastie (Oct 24, 2012)

Congratulations for such a useful thread, taz! I have a few comments if you don't mind:



			
				taz said:
			
		

> Another solution for Flash would be multimedia/quvi.


I've never used multimedia/quvi. Is it any different from www/youtube_dl? youtube-dl only depends on Python. If the latest version is not yet available in the ports tree, you can grab it from the GitHub page. I have it stored in a *$PATH* directory in my home directory. It can be updated easily using the *-U* option.



			
				taz said:
			
		

> If you don't care about gtk that much and want minimalism with security I would suggest you check out www/xombrero.


Even if it's not available in the ports tree, you can easily build Vimprobable. If you need tab support you can use it within x11/tabbed.



			
				taz said:
			
		

> And if you don't care about JavaScript check out www/links.


May I suggest www/elinks (tabs, mouse support, etc.)?



			
				taz said:
			
		

> And for a more "familiar" file manager like the on found on Windows that depends on gtk I suggest you chek out x11-fm/rox-filer.
> Their is also x11-fm/nautilus and x11-fm/thunar but they are far from "light" ports and would suggest to avoid them if you want minimalism.


I've tried/used most of these and many more. But none of them was good enough. Then I tried x11-fm/xfe and never looked back. It's a must for every minimalist setup!



			
				taz said:
			
		

> You can manage your torrent via WebUI which you will find if you enter this in you browser bar: "http://localhost:9091/".


*transmission-remote* can also be used to control everything from command-line.


----------



## nickednamed (Oct 24, 2012)

Great thread. I have an almost identical setup.

Wish you had written it a few months ago! Although, I suppose I wouldn't have had the "pleasure" of finding these things out for myself. :\

If I may, I would like to make a few suggestions, in case anyone finds them useful.

------[ Window manager
x11-wm/spectrwm This is another good, lightweight tiling window manager.

---[ Userland applications

------[ File Manager
misc/vifm This ncurses file manager uses vi-like bindings and commands so vim users will be right at home. It has no dependencies whatsoever.

------[ Movie and music player
audio/musicpd This music playing daemon [MPD] is very light, fast and featureful.
audio/ncmpcpp This MPD client is light, fast, and powerful.

------[ Torrent client
www/aria2 This downloader is like wget + bit-torrent. It dowloads EVERYTHING! It can also download a single file from multiple sources [EG http and ftp] at the same time. Compile without MySQL for lightweight use.


None of the programs mentioned above require any toolkits, and can be compiled with unneeded features turned off to make the as light as possible.

Also, This may be a bit off topic.. When you really MUST use a graphical application, requiring many libraries and toolkits, etc, I recommend using ports-mgmt/pbi-manager and installing a self-contained PBI of the application you need so your system desn't get bogged down with unnecessary files. Read more about that here if you wish.

And one more thing, I always run rxvt-unicode in daemon-client mode as it is much lighter on resources. Essentially 10 open terminals use no more memory than one terminal.

Just my two cents. Great tutorial, thanks.


----------



## taz (Oct 24, 2012)

> I've never used multimedia/quvi. Is it any different from www/youtube_dl? youtube-dl only depends on Python. If the latest version is not yet available in the ports tree, you can grab it from the GitHub page. I have it stored in a $PATH directory in my home directory. It can be updated easily using the -U option.



When I used www/youtube_dl I had to first download the .flv file and then play it with mplayer. With quvi I was able to stream videos so I just used quvi. Now I see I can do the same thing with youtube_dl so I will update the howto to use youtube_dl since it only needs python.



> May I suggest www/elinks (tabs, mouse support, etc.)?



Last update was 2009 and has no support for graphics mode. www/links (well it's actually links2) is still actively developed. Check out the home page. 



> I've tried/used most of these and many more. But none of them was good enough. Then I tried x11-fm/xfe and never looked back. It's a must for every minimalist setup!



Just installed it and it's so slow that I can't use it. I like it though and would like to update the howto with it. Any ideas why it's not working properly? No error messages, just brutally slow.



> transmission-remote can also be used to control everything from command-line.



True, updated the howto with this information.

EDIT:

Figured out why it was so slow and now works great! Anyway thank you for pointing x11/xfe to me I will update the howto.


----------



## KdeBruin (Oct 25, 2012)

Thanks for the extensive write-up. Had it running without any problems.


----------



## Crivens (Oct 25, 2012)

Great writeup - even when running FreeBSD as desktop and laptop already I will take one or two things over.


----------



## taz (Oct 25, 2012)

> And one more thing, I always run rxvt-unicode in daemon-client mode as it is much lighter on resources. Essentially 10 open terminals use no more memory than one terminal.



Yes that is true and I forgot to put it in the howto. I tried to update it but the post is to large. I will try to remove some text so I can put that information. Also thank you for your other suggestions I checked them out and added x11-wm/spectrwm to WM list.



> Thanks for the extensive write-up. Had it running without any problems.



Glad to hear that!



> Great writeup - even when running FreeBSD as desktop and laptop already I will take one or two things over.



Excellent! Although this howto is aimed for newcomers I was hoping other desktop users might find thing or two they can use.


----------



## SirDice (Oct 25, 2012)

taz said:
			
		

> True, but you get x11-drivers/xf86-video-vesa with  x11/xorg-minimal and I don't use VESA drivers.



Yes, but I assume you didn't write the howto for yourself. You also mention:


> Make sure MOUSE and KEYBOARD options are selected and select the video driver for your video card. You might also want to select VESA option just in case.



So it would be wiser to suggest installing x11/xorg-minimal.


----------



## taz (Oct 25, 2012)

Right, but with x11-drivers/xorg-drivers you can choose weather you want to have VESA as a backup or not. With x11/xorg-minimal you can not and I suggested to install VESA just in case,  but someone might not want to have it on their system (like me). Anyhow, I get what your saying but this way you have a choice and that is what I was aiming for in general.


----------



## Toast (Oct 25, 2012)

taz said:
			
		

> Right, but with x11-drivers/xorg-drivers you can choose weather you want to have VESA as a backup or not. With x11/xorg-minimal you can not and I suggested to install VESA just in case,  but someone might not want to have it on their system (like me). Anyhow, I get what your saying but this way you have a choice and that is what I was aiming for in general.



`# echo "VIDEO_DRIVER=<driver>" >> /etc/make.conf`
Just install x11-drivers/xf86-video-vesa after if you want it as a backup.



			
				taz said:
			
		

> Start rxvt-unicode with this command:
> `$ urxvt`



You can save memory by starting urxvt as a daemon (urxvtd()). Use urxvtc instead of urxvt.

------[ Torrent client
sysutils/tmux or sysutils/screen with net-p2p/rtorrent


----------



## taz (Oct 25, 2012)

> You can save memory by starting urxvt as a daemon (urxvtd). Use urxvtc instead of urxvt.



It has been mentioned a few post above yours and I know about urxvtd just forgot to put it in the howto. I'm trying to free some text form the post so I can update the howto with this info.



> ------[ Torrent client
> sysutils/tmux or sysutils/screen with net-p2p/rtorrent



net-p2p/rtorrent has been mentioned in the howto.  Is there any particular reason why you are suggesting a terminal multiplexer to be used with rtorrent?

EDIT:
never mind, figured out what you meant with sysutils/tmux or sysutils/screen.


----------



## taz (Oct 25, 2012)

Updated the info for urxvt in deamon/client and info for net-p2p/rtorrent since they fixed the CPU load problem on FreeBSD.


----------



## nekoexmachina (Oct 26, 2012)

Just 2c: 





> x11/rxvt-unicode is realy neat. It supports tabs via perl extension, stores text in unicode, has transparency if you want that slick look, configurable via ~/.Xdefaults file, lightweight, fast and most importantly it just works.


used tabs in terminal for some time, switched to tmux in 1 terminal window. More usable & more flexible.


> If you don't care about gtk that much and want minimalism with security I would suggest you check out www/xombrero.


Or www/vimprobable or www/xxxterm or etc etc etc


> For a pdf reader I have choosen graphics/mupdf. It's quite lightweight and fast.


You should try graphics/zathura. It is extermely-lite vim-like document viewer, supporting both pdf and djvu (probably more, but I use only this ones)


----------



## MasterOne (Oct 26, 2012)

Fantastic tutorial with a nice overview of options. I'd like to mention the following ports of interest:

x11-wm/i3
i3 is an improved dynamic, tiling window manager. Inspired by wmii that supported Xinerama.

multimedia/mplayer2
MPlayer2 is an advanced general-purpose video player. A fork of the original MPlayer project, it contains significant further development and supports a number of features not available in other Unix players.

I am about to try such a kind of installation with i3 as WM on my IBM ThinkPad T42p soon, so thanks for sharing this guideline.


----------



## morbit (Oct 28, 2012)

It's not _that_ minimal  e.g. you don't need all x11-fonts/xorg-fonts, panel, background... xterm is far from being minimal. Check x11/sterm.


----------



## jb_fvwm2 (Oct 28, 2012)

Another suggestion, install sysutils/lookat/ because after one exits the man page  (if it is set as the $PAGER) the man page persists (IOW if one exits lookat after viewing a man page with it, with the EXAMPLES onscreen, they are STILL THERE to be typed in, no need to have two terminals open nor write it down nor chance of typos in retyping it...). Can save one hours of time yearly. At least it does here... 
(Although some shells may do that already, some do not...IANAE).
.....................
Even another:  the configuration files x11-wm/ratpoison (for example)... 1... find out what they are called 2... grab a few from the web  3... test the downloaded files.  No need sometimes to even figure out the syntax, one gains weeks' worth of expertise at a few hours of cost.


----------



## wblock@ (Oct 28, 2012)

That depends on the terminal.  I think the "hide what you were just looking at" is a bashism.  It works correctly in csh(1).


----------



## taz (Oct 28, 2012)

morbit said:
			
		

> It's not _that_ minimal  e.g. you don't need all x11-fonts/xorg-fonts, panel, background... xterm is far from being minimal. Check x11/sterm.



Right but then again we don't actually need Xorg either . Anyway thank you for suggesting x11/sterm I added it to the list. Also updated the howto with sysutils/tmux and how to take a screenshot.


----------



## shepper (Oct 28, 2012)

I have a similiar setup with openbox/tint2/feh.  One option that is alluded to but not fully described is to to use the terminal "-e" option to make a menu item to run an ncurses based app.  I do this for ncmpc, top, midnight commander and rtorrent.  An example menu item for openbox:


```
<item label="rTorrent">
                        <action name="Execute">
                                <execute>
                                        xterm -e rtorrent
                                </execute>
                        </action>
                </item>
```


----------



## taz (Oct 28, 2012)

shepper said:
			
		

> I have a similiar setup with openbox/tint2/feh.  One option that is alluded to but not fully described is to to use the terminal "-e" option to make a menu item to run an ncurses based app.  I do this for nmcpc, top, midnight commander and rtorrent.  An example menu item for openbox:
> 
> 
> ```
> ...



True, I have added a comment for that in the "Launching applications" section.

Also a small update: added the "Misc" section for disabling beep sound and setting UTF-8.


----------



## user1 (Nov 6, 2012)

Hello, first just wanted to say thank you for this tutorial!

I recently got a job that uses FreeBSD on their servers and Ive been working on setting up a dual boot on my home PC.  I really wanted a basic GUI to help me make my swap a little easier so I was following your tutorial.

I ran into a problem at the # portmaster x11-wm/openbox command. It keeps hanging during the install. I ctrl+c(ed) it a couple times to try to get past the hang but it keeps hanging. This seemed to work in previous installs when it would hang but not for the openbox. Is there a way to skip a file when it hangs? I will try installing another window manager if I need to but I'd like to follow close to your tutorial since this is my first time attempting an install.

Also the nvidia command wasn't working, I figured I could add the drivers later so I didn't go to far into this.

One thing to note, I am logged in as root and have been using su to use portmaster for the installs.  Not sure if this has any effects on the errors im running into.


----------



## SirDice (Nov 6, 2012)

user1 said:
			
		

> One thing to note, I am logged in as root and have been using su to use portmaster for the installs.  Not sure if this has any effects on the errors im running into.



If you are already root there's no need for su(1).


----------



## user1 (Nov 6, 2012)

Just came home and it moved past the hang, looks like it was just really slow, should have waited a bit longer before posting, good guide! Thanks again.


----------



## taz (Nov 6, 2012)

user1 said:
			
		

> Just came home and it moved past the hang, looks like it was just really slow, should have waited a bit longer before posting, good guide! Thanks again.



Glad to hear that it worked. If you have another questions feel free to ask and post a feedback if you manage to successfully set everything up.


----------



## user1 (Nov 8, 2012)

Just wanted to post an update.  I've been trying to get this installed and working correctly but had no success.  I ended up reformatted FreeBSD to start fresh then I had issues getting my WiFi to work correctly.  It was intermittent so I changed to a wired connection and had no connectivity problems.  I started going through the guide again (made sure to follow everything to a T) and I got stopped at the Xorg -configure command.

Prior to this command there were a lot of corrupt files in the portmaster installs of the x11 files(im guessing this is the reason my install failed).  I wrote down a list as I was going through the install, these are the errors I came into before the Xorg -configure command.

Corrupt during installs: 
x11-servers/xorg-server failure @ x11keyboard-config
x11-drivers-input-keyboard-config
libxi xf86-input-mouse
nvidia-driver
keyboard-config

Command not found: Xorg -configure


I am still interested in getting this to work but for now I am going to go the easy route and install another GUI.


----------



## user1 (Nov 8, 2012)

Just got finished installing gnome.  Not really what I was hoping for but it will have to do until I get a better understanding of FreeBSD.  Portmaster seems to be causing a lot of errors with my install.  I kept getting corrupt files and the installations would not complete correctly.  The last reformat I did (my 5th one :r) I tried using pkg_add instead of portmaster and xorg/gnome installed without any corrupt files.  I may try this guide again using the pkg_add variants of the portmaster commands on a virtual machine and see how the install goes.  For now I am going to stick with gnome on my PC until I get a little more comfortable.


----------



## CyberBSD (Nov 11, 2012)

Thank you for your nice guide, Taz. It helped me a lot. 

Unfortunately it doesn't include instructions how to place a language indicator/switcher at the taskbar. I believe it will be very useful for anyone who uses more than one language. To add the language indicator I did following:

#> portmaster x11/xxkb

then placed the line:

(sleep 2 && xxkb) &

after the line:

(sleep 2 && tint2) &

of ~/.config/openbox/autostart.sh

and put the following data in to the config file ~/.xxkbrc:


XXkb.image.path: /usr/local/share/xxkb/
XXkb.mainwindow.type: tray
XXkb.mainwindow.enable: yes
XXkb.mainwindow.image.1: en15.xpm
XXkb.mainwindow.image.2: ru15.xpm
XXkb.mainwindow.image.3: ua15.xpm
XXkb.mainwindow.image.4:
XXkb.mainwindow.appicon: yes
XXkb.mainwindow.geometry: 20x20+2+2
XXkb.mainwindow.in_tray: true
XXkb.button.enable: no
XXkb.controls.add_when_start: yes
XXkb.controls.add_when_create: yes
XXkb.controls.add_when_change: no
XXkb.controls.focusout: no
XXkb.mainwindow.xpm.1: en48.xpm
XXkb.mainwindow.xpm.2: ru48.xpm
XXkb.mainwindow.xpm.3: ua48.xpm
XXkb.mainwindow.label.enable: no
XXkb.controls.two_state: no

Sorry for bad formatting. Xombrero just doesn't allow to click any buttongs except at the toolbar.


----------



## sub0 (Nov 13, 2012)

My 2cents.. the first three things i find very useful to have at hand after a new install (way before i even think of X) are: 
1) Handbook
2) tmux 
3) lynx
You open two panes in tmux, work your way through the installation in one, and keep the other in /usr/local/share/doc/freebsd/handbook with lynx ready to allow you to navigate through the docs. Whatever goes wrong, you have nicely formatted help always at hand


----------



## shepper (Nov 13, 2012)

> My 2cents.. the first three things i find very useful to have at hand after a new install (way before i even think of X) are:
> 1) Handbook
> 2) tmux
> 3) lynx
> You open two panes in tmux, work your way through the installation in one, and keep the other in /usr/local/share/doc/freebsd/handbook with lynx ready to allow you to navigate through the docs. Whatever goes wrong, you have nicely formatted help always at hand



I tend to do the same thing albeit in OpenBSD.  The Base install includes X, xterm, lynx, tmux, ftp and some basic editors.  I often open 4 xterms in fvwm:
1)  xterm for pkg_add
2)  xterm to paste in script options that are presented by pkg_add, configure rc.conf.local, local config files like .rtorrent.rc
3)  xterm that contains an ftp list of the available software so that I get the spelling right (musicpd vs mpd, abcde vs abcde-lame etc) and make sure the package actually exist on the server I have configured.
4)  xterm for lynx or eventually a html browser so I can get info (interface, number of dependencies, etc) when choosing between packages

The other thing that may help others who are doing multiple installs is that I set up an ftp server on the first install.  It makes is easy to pull redundant config files (/home/user/.config/openbox/autostart etc) rather than going back and forth with a usb thumb drive.


----------



## mcochris (Dec 2, 2012)

Great tutorial, thanks!

I like the flwm window manager, very light and easy to configure.


----------



## morbit (Dec 2, 2012)

csup is deprecated, I would recommend updating guide for portsnap. Moreover, mc-light is a bit saner than mc.


----------



## vermaden (Dec 2, 2012)

morbit said:
			
		

> Moreover, mc-light is a bit saner than mc.



There is also *lfm* and *vifm*.


----------



## MasterOne (Dec 15, 2012)

Does anybody know of a GUI frontend to mplayer / mplayer2 other then SMplayer (which requires QT), which remembers media settings and time positions of played files, and better fits into a minimal desktop (without QT dependency)?

This is such a nice feature, to be able to simply close the player during playback, and resume watching at the same point on next use.


----------



## vermaden (Dec 15, 2012)

MasterOne said:
			
		

> Does anybody know of a GUI frontend to mplayer / mplayer2 other then SMplayer



Try gnome-mplayer.


----------



## MasterOne (Dec 15, 2012)

vermaden said:
			
		

> Try gnome-mplayer.


The emphasis of my question was on "which remembers media settings and time positions of played files", and as far as I remember, gnome-mplayer does not have such a feature.


----------



## bbzz (Dec 15, 2012)

There's a wrapper for mplayer which does exactly that, in perl.


----------



## copypaiste (Dec 23, 2012)

In case anyone needs a tray sound control knob, here one made by a friend of mine. https://github.com/svagner/gtmixer 
There's no port available yet, but maybe we'll make it sometime.
ps: Written for GTK+. Tested with openbox+tint combo. Provides volume and equalizer controls.


----------



## bozzy (Jan 31, 2013)

Anyone got any hints tips and traps on vBox filesharing? I have not been able to get shared folders working on a FreeBSD VM though they work fine for me on an ArchLinux VM on the same host.


----------



## wblock@ (Jan 31, 2013)

VirtualBox shared folders is not implemented for FreeBSD guests yet.


----------



## bozzy (Feb 1, 2013)

wblock@ said:
			
		

> VirtualBox shared folders is not implemented for FreeBSD guests yet.



Thanks. I'll use writes to a Samba share external to the VM which should achieve the same thing. Sweet thread BTW.


----------



## rijsmier (Feb 1, 2013)

This Howto was done for FreeBSD 9.0.   Would the same apply to 9.1?


----------



## taz (Feb 4, 2013)

rijsmier said:
			
		

> This Howto was done for FreeBSD 9.0.   Would the same apply to 9.1?



It would...


----------



## mruhe-s (Feb 4, 2013)

Hi Taz,

excellent work - was looking for such detailed instructions for a long time for FreeBSD.

Thanks
Michael


----------



## taz (Feb 5, 2013)

mruhe-s said:
			
		

> Hi Taz,
> 
> excellent work - was looking for such detailed instructions for a long time for FreeBSD.
> 
> ...



Thank you for the positive feedback! When I get some free time I will add some new useful stuff. For example I found a nice perl plugin for urtvx that enables copy/paste via Ctrl-c for example or some other user defined key binding. I thing it's a way better option than the middle click especially for someone who uses the terminal a lot.

Ultimately my goal would be to program and post a script that dose automated minimal install of Xorg and user land ports of choice. Not as in the "whole ports collection" choice but rather a selected one of most commonly used ports for segments defined in my howto (window manager, browser, editor etc.).
Since I compile everything rather than use packages setting up a fresh desktop can be time consuming. With a script I could just run it over night and in the morning it's done and configured, but without the bloat that would come along with for example gnome or kde.

I already have such a script but it's not relay ready for "global" usage nor tasted properly.


----------



## mruhe-s (Feb 6, 2013)

Hi all,

I have a problem with Conky. It's displayed but I cannot change the font and font size - at least it seems conky doesn't accept font/size changes. Here the error message:

```
conky can't load font "Bitstream Vera Sans Mono:size=12" but
usr/local/lib/X11/fonts/bitstream-vera is available.
```
Any advice would be appreciated.


----------



## mruhe-s (Feb 7, 2013)

*FreeBSD 9.1 conky issue*



			
				mruhe-s said:
			
		

> Hi all,
> 
> I have a problem with Conky. It's displayed but I cannot change the font and font size - at least it seems conky doesn't accept font/size changes. Here the error message:
> conky can't load font "Bitstream Vera Sans Mono:size=12" but
> ...



[SOLVED] seems to be a bug when using "make install clean" XTF will not be compiled when selecting XTF support. Open the "Make file" and change to XTF = On. Then this option will be compiled and conky can be configured with other fonts/font sizes.
Michael


----------



## taz (Feb 7, 2013)

mruhe-s said:
			
		

> [SOLVED] seems to be a bug when using "make install clean" XTF will not be compiled when selecting XTF support. Open the "Make file" and change to XTF = On. Then this option will be compiled and conky can be configured with other fonts/font sizes.
> Michael



glad you fixed it!

EDIT: removed my initial reply since I overlooked something in your reply.


----------



## taz (Feb 8, 2013)

Updated the howto with some new info and replaced some old ones like csup() with portsnap().


----------



## jwele (Feb 11, 2013)

This is a fantastic tutorial. I am going to link this on my Google+ profile. Thanks for putting in the time to make a good How To.


----------



## mruhe-s (Feb 12, 2013)

*openbox keybinding issue*

I followed the instructions and everything seems working except of keybindings.
Ctrl, Alt and the Window key are not recognized. Did I miss something?
Seems that Xorg.conf is configured correctly.

Thanks for sharing any idea.

Michael


----------



## BJwojnowski (Feb 13, 2013)

On an older system I had installed FreeBSD 8.x and was able to have a minimal desktop FreeBSD setup.  I have just now tried to get reaquainted to UNIX and have successfully established FreeBSD_9.1-release AMD64 as a dual boot system on a Toshiba Satellite L770.  The barebones of FreeBSD work.  I however have not been able to access the internet within the FreeBSD structure and getting to what pertains to this thread is that I can not get portsnap fetch; portsnap extract; portsnap update to work.  Sorry I do not know the exact message I rcv but when I do a "make search name=portsnap" it tells me nothing in the moved line and says it is part of FreeBSD base system since FreeBSD 5.1.  The positive thing about my question is that I do have a dual boot system so I can access FreeBSD forum in my windows 7 boot.  I have been trying to read all the FreeBSD literature I can and access all the functions I know to become more adept at UNIX.  I apologize for this longwinded call for help.  Please contact me if you think we can successfully work together.


----------



## BJwojnowski (Feb 13, 2013)

I switched backover to the FreeBSD OS and logged into root.  To my chagrin the portsnap commands worked.  I am going to print this entire thread and see if I can successfully enact what it suggests.  Thank you.


----------



## taz (Feb 14, 2013)

mruhe-s said:
			
		

> I followed the instructions and everything seems working except of keybindings.
> Ctrl, Alt and the Window key are not recognized. Did I miss something?
> Seems that Xorg.conf is configured correctly.
> 
> ...



Did you try to plug in some other keyboard and see if it works then?


----------



## mruhe-s (Feb 14, 2013)

taz said:
			
		

> Did you try to plug in some other keyboard and see if it works then?



Hi taz,

no, I didn't have crunchbang 11 on another Partition where these keys are working fine.
I also added setbkdmap with the parameter used by Xorg.conf into the autostart file.
but no success so far. When using the termnial terminator at least Crtl + keycode is working.
Next step what I will check is xmodmap - hope to be successful there. It's strange but I am using FreeBSD since a long time - version 4.5 - and your excellent tutorial for openbox inspired me to apply this window manager. 

If helpful I can share all my config files.

Regards
Michael


----------



## shepper (Feb 15, 2013)

The popularity of this thread suggests that a lightweight, BSD friendly desktop is desired by many.  I suggest that the following features can be added targeting FreeBSD, OpenBSD and NetBSD.
  1) Tint2-0.11-svn  allows the creation of launcher panel bar entries -  frequently used applications such as browser, email and terminal can be launched by panel click.  Addition of xdotools and the creation of a usr/local/share/applications/menu.desktop results in a panel menu that matches the openbox menu.  Tint 2-svn is used in Debian Wheezy and is an Option is available in ArchBang CrunchBang and Gentoo.
  2) Systray applets for battery strength, audio volume and network connection.  FreeBSD could use volumeicon (oss compatible) but OpenBSD, NetBSD sndio incompatible.  I am presently looking a forking the volumeicon code to be compatible with BSD's.

To the moderator:  If the idea of using the lightweight desktop thread as basis for a BSD specific Desktop grows feel free to move it to a new thread.


----------



## Beastie (Feb 15, 2013)

@shepper:

What you propose goes against minimalism. BSD systems are general-purpose systems. You can do whatever you want with them which includes creating your own minimalist distribution. But you run the risk of creating a new GNU/Linux monster.
The base system can't be modified to suit the needs of desktop users.

Also you can't impose third-party applications on the rest of us. I run a minimalist system myself and have never used the applications you're talking about. The last time I've used a panel, system tray, icons, etc. at all was years ago!
These applications are available in the ports tree though, so you're free to include them in your system.

Furthermore there might be a problem with licensing.

Or am I misunderstanding you? Are you proposing, for example, that the FreeBSD Project makes a customized Xorg (like OpenBSD's Xenocara)?


----------



## shepper (Feb 15, 2013)

@Beastie

I do not advocate imposing third party applications on anybody. The slant I was taking on minimalism was trying to avoid the addition of a large number of dependencies in order to add a simple feature to an individuals Desktop.  The original poster gave examples of various panels and personally used tint2.  What I was pointing out was that newer tint2 code is available but has not been packaged into a release.  The license is the same, no new dependencies are needed and it appears to be stable enough for the upcoming Debian Wheezy release.  I was looking at patching the build pulling the source from the Debian repositories.

An optional feature that can be added at the users discretion is a simple volumeicon that can go in the systray.  From a BSD standpoint the volume icon only supports alsa and oss output.

I have tried some other Desktops and found similar "linuxism".  Volume control in e17 is either alsa or pulseaudio. Volume control in fbpanel is either alsa or oss.  The OpenBSD developers recently had to add pulseaudio as a Gnome3 dependency. Another glaring example is the addition of hal to FreeBSD xorg.  In retrospect it would have been nice to avoid hal but I understand why the FreeBSD developers made the decision.

I am into the second chapter in a book on C coding and would like to apply what I learn to the volumeicon code base by stripping out alsa and adding sndio output to support NetBSD/OpenBSD.  Call it something like "bsdvolumeicon".

So to clarify,  I am proposing that a modular desktop project could be started that was BSD friendly and is minimal in the aspect that linux compatibility layers were bypassed.  In the case of a volume control applet, no pulseaudio, no alsa wrappers, no esd.  Just direct control of the core sound system.

Battery applets, network managers would be other options.


----------



## taz (Feb 15, 2013)

@shepper

I'm not sure whether you are talking about making some sort off minimal BSD "distribution" or not but if you are recently ArchBSD started to develop so you might want to chek that out.

As far as "modular desktop project" goes I guess I already started it but my idea is not a "BSD distribution" but rather a shell script/ncurses based program (haven't decided yet) where you could choose witch ports you want to install. Let's take window managers for example: the script would have a built in list of most used WMs and would know what is need to configure each WM. For example if you choose Openbox. The script would then run "make config" so you could enable/disable compile options and upon compilation it would run these commands:


```
$ mkdir ~/.config
$ mkdir ~/.config/openbox
$ cp /usr/local/etc/xdg/openbox/menu.xml ~/.config/openbox/menu.xml
$ cp /usr/local/etc/xdg/openbox/rc.xml ~/.config/openbox/rc.xml
$ touch ~/.config/openbox/autostart.sh && chmod +x ~/.config/openbox/autostart.sh
$ echo "#!/bin/sh" >> ~/.config/openbox/autostart.sh
$ echo "exec openbox-session" >> ~/.xinitrc
```

making openbox ready for further personal customization. Without the script you would have to type in this commands anyway and it would be a time saver if you had a script that would do this for you.

I don't like the idea of a "distros" in general but mostly because of precompiled packages.

But I think you are talking about programming small utilities like the volume manager that would use existing FreeBSDs integrated tools instead of going through something form the "linux world". To make it clear example would be automounting. People use HAL for that but FreeBSD has devd. If that is the case I fully support the idea but I don't thing you need to start a "modular desktop project" but rather just make a list of what you thing can be done the "FreeBSD way" and make individual ports for that. People will then choose what to include in their own FreeBSD system.

For me and I thing other users that like minimalism it's about choice.


----------



## mruhe-s (Feb 15, 2013)

mruhe-s said:
			
		

> Hi taz,
> 
> no, I didn't have crunchbang 11 on another Partition where these keys are working fine.
> I also added setbkdmap with the parameter used by Xorg.conf into the autostart file.
> ...



[Solved]
I am an idiot ....playing around with ~/.config/openbox/rc.xml
didn't realized while copying a number of lines around that </keyboard> was already set and I copied just thereafter...mystery of vi().... be careful ;-)
Now everything is working as expected...

Thanks 
Michael


----------



## taz (Feb 16, 2013)

mruhe-s said:
			
		

> [Solved]
> I am an idiot ....playing around with ~/.config/openbox/rc.xml
> didn't realized while copying a number of lines around that </keyboard> was already set and I copied just thereafter...mystery of vi.... be careful ;-)
> Now everything is working as expected...
> ...



hehe glad you figure it out


----------



## shepper (Feb 16, 2013)

I emailed the tint2 author and he replied that he intends to release the svn code sometime in March 2013.  He was holding the code to correct the configuation wizard but realizes he does not have the time to deal with the wizard.

Here is a link to the Arch wiki that describes howto setup the launchers and use xdotools.  Additionally, one can add an entry to /usr/local/share/applications as in this Arch thread.  The screenshot in the thread shows the results.  The nice thing about this approach is that the right-click openbox menu will match the one from the tint2 panel.

The linux specific volumeicon I mentioned earlier is in the screenshot.  I tried it in Debian Wheezy and it works well,  one can hover the mouse over the icon and adjust the volume with the scroll wheel.


----------



## BJwojnowski (Feb 20, 2013)

ok.  I have done as directed and everything worked.  I still have not modified or set options in /usr/local/etc/portmaster.rc.  I have not looked at the sample file yet.  I am elated that everything installed as advertised.  Looking ahead a little I have seen that the hal option should be disabled in all packages since DEVD is going to be used.  My question is "How do I find out which files have a hal option and which do not?"  I am now going to look at portmaster.rc.sample.  Thank you for this fairly straightforward set of instructions.


----------



## taz (Feb 20, 2013)

BJwojnowski said:
			
		

> ok.  I have done as directed and everything worked.  I still have not modified or set options in /usr/local/etc/portmaster.rc.  I have not looked at the sample file yet.  I am elated that everything installed as advertised.  Looking ahead a little I have seen that the hal option should be disabled in all packages since DEVD is going to be used.  My question is "How do I find out which files have a hal option and which do not?"  I am now going to look at portmaster.rc.sample.  Thank you for this fairly straightforward set of instructions.



When you try to compile a port with portmaster or 

`# make install clean`

for the first time you will see a dialog from which you can choose what options you wish to enable. HAL will be listed there if that port has a HAL option. So just make sure you don't have [X] next to it.

You can also invoke the same dialog with:

`# make config`

Also http://www.freshports.org/ shows options and "Required To Run:" ports.

You can also run this command to se if any of the already installed ports require HAL:

`$ pkg_info -R hal-\*`


----------



## BJwojnowski (Feb 21, 2013)

I ran `portmaster x11-servers/xorg-server` and it successfully installed 23 to 25 ports.  The problem IS ran into somewhere along the way it became caught in an endless loop: 

misc/dejagn>>lang/expect>>x11-toolkits/tk84>>x11/libx11>>>>x11/libxcb>>lang/python27>>devel/libffi

The above I transcribed to paper and now I am sending it to you via my tablet.  I think the error resides in the tk84file since `portmaster` gave several installation options and I vaguely remember tk84 dependency being given as an option.  Is there an easy way to try to run `portmaster x11-servers/xorg-server`from the beginning so I can be given the option menu again or do you have a better way to do it?


Thank you for all the help.


----------



## BJwojnowski (Feb 21, 2013)

taz,
what I have done so far today after having an unsuccessful `portmaster x11-servers/xorg-server` run is that I have done a `pkg_delete -a` and then repeated `portsnap fetch`, `portsnap extract`, and `portsnap update`.  The computer I am working on is doing those commands now.  I will still have to do a `cd /usr/ports/ports-mgmt/portmaster/ && make install clean.`

I have however done nothing to directly address the problem with `portmaster x11-servers/xorg-server`.  I have several questions.  In the above mentioned process what other files are compiled and stored if any?  what files do I delete and which ones do I keep?  As I sit and think of this problem I do regret that I do not make backups of the file system.  The system I am working on has as / a 50GB slice, swap 10GB, /var 100GB, /tmp 100GB, /usr 100GB, and /home 80GB file systems on the HD.  I am making you aware of this because I became aware of the endless loop only after the error messages started coming up telling me that the SWAP space was exhausted.  It then told me as well /tmp/f-1366-IPC_SAVE.HJ84wgls: 3: Syntax error "(" unexpected.


----------



## taz (Feb 21, 2013)

Ok, ports have dependence, right? Some of thees dependencies are "required to build" and some of them are "required to run". The "required to build" dependencies are only needed when you compile and will not be needed after. Make file will check if thees dependencies (both required to build and required to run) are installed on your system and if not it will compile them (the ones that are missing).

Now to get the list of "required to build" and "required to run" dependence's go to http://www.freshports.org and search for a port. In this case this would be xorg-server.

As you can see in the provided link xorg-server has a lot of "required to build" dependencies and it will take a while to compile all of that. To avoid this you uncomment this lines in your /usr/local/etc/portmaster.rc


```
# Install packages for build-only dependencies (--packages-build)
PM_PACKAGES_BUILD=pmp_build
# Delete build-only dependencies when finished (--delete-build-only)
PM_DEL_BUILD_ONLY=pm_dbo
```

This way portmaster will fetch packages for "required to build" dependencies and you won't need to compile them. Also it will delete them after it's finished with building xorg-server.

So to answer your question you don't need to know which files you need to keep or delete it's all automated.

If you wish to change the compile options for a certain port. cd to that ports folder (I'm using xorg-server as an example)

`# cd /usr/ports/x11-servers/xorg-server/`

and then run this command:

`# make config`


----------



## BJwojnowski (Feb 22, 2013)

Taz,


Uncommenting those two lines in /usr/local/etc/portmaster.rc has already been done.  I uncommented the lines as suggested in your very informative [how to].  Do I need to change the permissions on /usr/local/etc/portmaster.rc?  By default the permissions for owner(I am not sure if that is me), group, and everyone were only _r_ .  I changed them (by using `chmod 777` to edit using vi() and then changing them back with `chmod 444 /user/local/etc/portmaster.rc`. Do any of the permissions need to be execute?


Thank you for your patience with me.


----------



## taz (Feb 22, 2013)

No, the file is used only for reading.


----------



## wblock@ (Feb 22, 2013)

BJwojnowski said:
			
		

> chmod 777



Don't do that.  If you find yourself doing it, realize that it is a mistake and stop.


----------



## BJwojnowski (Feb 23, 2013)

*Alright.*

How do I uncomment the lines indicated if the file is read only?


----------



## BJwojnowski (Feb 23, 2013)

*Now I see*

I will do as you indicated in the explanatory reply to me.  I did not think of it that way.  I now even more clearly understand do not assume anything.  Thank you.


----------



## wblock@ (Feb 23, 2013)

BJwojnowski said:
			
		

> How do I uncomment the lines indicated if the file is read only?



It's not read-only to the root user.


----------



## BJwojnowski (Feb 23, 2013)

*RE:  Status*

Well I finally done did it.  Running `portmaster /x11-drivers/xorg-drivers`I once again became caught up in an endless loop.  There was no way to get out of it but do a hard stop.  The endless loop proved to be a vicious circle.  My laptop will not boot at all.  I believe and hope it is only the hard drive that crashed for the computer will not boot at all.  The endless loop was telling me that the swap space was exhausted.  Hard for me to believe since I allocated 10 GB to it.  Any suggestions?


----------



## BJwojnowski (Feb 24, 2013)

Well, the computer not working was just a temporary scare.  By disconnecting all power, discharge press of power button, waiting ten minutes and reconnecting computer it came back to life.  

The problem still faces me.  How do I get X windows, a simple window manager, and desktop to work within the FreeBSD framework of my Toshiba Satellite L770 laptop?


----------



## BJwojnowski (Feb 24, 2013)

Ok.  I tried to run `portmaster x11-servers/xorg-server`in the /usr/ports/x11-servers/xorg-serverdirectory.

The good news is that 96 files successfully compiled.

The bad news is that I keep getting stuck in a recursive loop.  It spins round and round occasionally catching a "cog" and prints out the following or something similar:

```
===> port Directory: /usr/ports/x11-toolkits/tk84
  ===> Starting Check for build dependencies
  ===> gathering dependency list /usr/ports/x11-toolkits/tk84
```

/usr/ports/x11-toolkits/tk84 >> x11/libx11 >> x11/libxcb >> lang/python27 >> devel/libffi >> misc/dejagnu >> lang/expect >> x11-toolkits/tk84

I do a ctrl-C ]to break the loop and exit.

What am I doing wrong?

What can I do to remediate this issue?

Is my continuous questioning becoming irritating?  If, yes, I apologize and will quit this line of questioning.

Thank you once again for your responses and the instructions.  Without the "installing a minimum X system"  I would not have even gotten this far.  Thank you.


----------



## wblock@ (Feb 24, 2013)

Please start a new thread.  As the topic becomes more and more different from the title, the chance of getting useful responses drops.


----------



## jwele (Feb 25, 2013)

Everything went perfectly except DVD/CD's will not mount. 


```
(cd0:ata5:0:0:0): READ DVD STRUCTURE. CDB: ad 0 0 0 0 0 0 1 0 8 0 0 
(cd0:ata5:0:0:0): CAM status: SCSI Status Error
(cd0:ata5:0:0:0): SCSI status: Check Condition
(cd0:ata5:0:0:0): SCSI sense: ILLEGAL REQUEST asc:30,2 (Cannot read medium - incompatible format)
(cd0:ata5:0:0:0): Retrying command (per sense data)
(cd0:ata5:0:0:0): READ DVD STRUCTURE. CDB: ad 0 0 0 0 0 0 1 0 8 0 0 
(cd0:ata5:0:0:0): CAM status: SCSI Status Error
(cd0:ata5:0:0:0): SCSI status: Check Condition
(cd0:ata5:0:0:0): SCSI sense: ILLEGAL REQUEST asc:30,2 (Cannot read medium - incompatible format)
```

I am unsure how to fix it or if it is sysutils/automount related.


----------



## jem (Feb 27, 2013)

What sort of disk do you have inserted?


----------



## jwele (Feb 27, 2013)

jem said:
			
		

> What sort of disk do you have inserted?



Last night I said screw it, YOLO, and recompiled x11-servers/xorg-server to have HAL support, added dbus_enable="YES" and hald_enable="YES" to my /etc/rc.conf, and restarted X/ started HAL. Worked like a charm. I was watching my DVD "Harold And Kumar" in no time. When I made the post I was trying to get a CD to work and have yet to try it again to see if I can play it.

VLC is unable to play the DVD even though I can see my DVD mounted in lshal, and x11-fm/xfe. The only thing I have issues with currently are VLC not reading my DVD and my cell phones MTP filesystem not mounting or accessible via x11-fm/xfe.








I also made an icon for who ever is listening out there, yes you.
HERE


----------



## taz (Feb 27, 2013)

Well, it looks great! 

I haven't plugged in a CD/DVD for ages so I tryed to mount one now to se what's what. Anyway sysutils/automount won't mount your cdrom so you would have to do it manually.

I issued this command and it worked with a CD and a DVD:

`# mount_cd9660 /dev/cd0 /mnt`

Did you try this before you enabled HAL?

Also I will have to update the howto with this info.


----------



## jwele (Feb 27, 2013)

Thanks, been loving the setup so far. I tried the `# mount` command and threw it the type cd9660, I know I tried a manual mount, but I received an error message. I will try the command you listed when I get home though. I am pretty sure the mount command I tried was based on the handbooks command. I know I also tried a few different programs. After some reading of the devd(8) man page I noticed it wouldn't be able to tell when a CD/DVD was inserted so In the interested of less bloat and overall efficiency I just added HAL.

If I can somehow query `$ dmesg | tail` to find out when a DVD/CD was inserted and mount it with devd(8) I would because It seems very lightweight.


----------



## taz (Feb 27, 2013)

Well, personally, I would rather manually mount the cdrom than use HAL. But that's just my opinion


----------



## jwele (Feb 27, 2013)

taz said:
			
		

> Well, personally, I would rather manually mount the cdrom than use HAL. But that's just my opinion



I would have but I could not get it to work. I never knew there was a `# mount_cd9660 /dev/cd0 /mnt` command so I will try that when I get home and if it is successful I will remove HAL.


----------



## wblock@ (Feb 27, 2013)

The preferred way is to use mount(8) and let it figure out the appropriate individual mount program.  So that would be
`# mount -t cd9660 /dev/cd0 /mnt`


----------



## jwele (Feb 27, 2013)

wblock@ said:
			
		

> The preferred way is to use mount(8) and let it figure out the appropriate individual mount program.  So that would be
> `# mount -t cd9660 /dev/cd0 /mnt`



This was the command that I couldn't remember earlier that I tried but was returned an error. I will try to execute it again when I get home without HAL running to see if it works and if not what the error I received was. Thanks for the post wblock


----------



## Crivens (Feb 27, 2013)

No not forget to add -o ro to the mount. CDs are not really that easy to write to


----------



## wblock@ (Feb 27, 2013)

The cd9660 filesystem is readonly anyway.  No options needed.


----------



## Crivens (Feb 28, 2013)

Hmm, I remember having trouble with that - but then again maybe it was some NTFS mount which needs to be r-o because the base ntfs-fs can not write to it.


----------



## shepper (Apr 23, 2013)

shepper said:
			
		

> @Beastie
> 
> 
> An optional feature that can be added at the users discretion is a simple volumeicon that can go in the systray.  From a BSD standpoint the volume icon only supports alsa and oss output.
> ...



In follow-up to my prior posts I found a systray volume control applet in Freshports.  Gvolwheel works well with tint2.

Now if I can just figure out how to get it working in OpenBSD


----------



## michaelrmgreen (May 6, 2013)

I'm stuck at this point 





> If you are using nvidia-driver run:
> 
> # nvidia-xconfig


Trying to run that command returns a 
	
	



```
Command not found
```
 error. I found a file with that name in /usr/ports/x11 but trying to run that returns a 
	
	



```
Permission denied
```
 error.

Any ideas on how to troubleshoot this problem?


----------



## Dies_Irae (May 6, 2013)

michaelrmgreen said:
			
		

> Trying to run that command returns a  error.



Beacause you have not installed it (it's not in the x11/nvidia-driver port).

You have to install x11/nvidia-xconfig



			
				michaelrmgreen said:
			
		

> I found a file with that name in /usr/ports/x11 but trying to run that returns a  error.



Because it's not a file, it's a port directory.

As root:
`cd /usr/ports/x11/nvidia-xconfig
make install clean`


----------



## steve612 (Jun 29, 2013)

Hello,

What about installing _O_ffice? Is Open_O_ffice_.org_ going to work with this setup? I am new to FreeBSD, forgive me I am _a_ noob.

Thanks*.*


----------



## morbit (Jun 29, 2013)

You can always install editors/libreoffice or editors/openoffice-3.

As with all ports, they will pull in needed dependencies.

I'm currently partial to LibreOffice because of code re-factoring and dependencies clean up, but both are maintained and should satisfy your needs.


----------



## blazingice (Aug 9, 2013)

I just wanted to say thank you for this great howto. I often used _L_inux (e.g. _C_runch_B_ang) if I needed a light minimal desktop, because I wasn't very confide_nt_ at setting up FreeBSD to do this. PC-BSD was another option, but that is not very light and minimal anymore. After following this howto, I don't see the need to use _L_inux as a light desktop anymore. I hope this howto continues to be updated and refined as it is a great help to all newcomers like me. I have two suggestion that could improve this:

Set up a public _PKGNG_ repository with only the packages mentioned, which are built with the correct options.
Write an interactive script that can be run after a default installation.
This would mean that you can have a minimal desktop in few minutes without having to wait to build all the ports and copy-paste all the necessary config files. I am happy to help with the first one, but unfortunately I have never written a script in my life.


----------



## bart (Aug 10, 2013)

Here, is my (become old) auto install script for my minimal but full FreeBSD.


----------



## germanopratin (Aug 26, 2013)

Thank you very much for your howto. This is exactly what I have been looking for, for quite a long time. As a Slackware user I totally share your views on how a perfect OS should be, above all simple and tailored to exactly the smallest footprint that fits the intended use. So no bloat, no piles of dependencies. Clean and controllable. 

It's one thing that disturbs me with most package management systems, that if you don't read the dependencies carefully, you can get lost in a sea of dependencies just by typing an innocent `pkg_add`, for instance. You start with a clean system - and then the package manager pulls dependencies in and sub-dependencies and so forth.

Great work! I will give that a try!


----------



## xenphor (Oct 27, 2013)

What is device support like for FreeBSD besides mouse and keyboard? I'm thinking mainly about gamepad/joysticks, which work well in Linux with evdev/udev. Most new devices should just be generic HID I think. 

I read that there was some Linux joystick compatibility for FreeBSD but that it's broken now. Is it possible to use modern gamepads using devd or something else specific to FreeBSD?


----------



## zennybsd (Nov 10, 2013)

*Didn't work in FreeBSD10-**

Nice tutorial, but this failed to work both with legacy xorg-server as well as new xorg in FreeBSD10-*. 

`portmaster x11-severs/xorg-server` yields an intermittent error:


```
../../../src/mesa/main/mtypes.h:3420:4: error: unknown type name 'GLDEBUGPROCARB'
   GLDEBUGPROCARB Callback;
```


```
<snip>
Making all in builtin_compiler
gmake[5]: Entering directory `/usr/ports/graphics/dri/work/Mesa-9.1.6/src/glsl/builtin_compiler'
  CXX      glsl_lexer.lo
c++: warning: argument unused during compilation: '-fno-builtin-memcmp'
In file included from glsl_lexer.ll:27:
In file included from ../../../src/glsl/ast.h:30:
In file included from ../../../src/glsl/glsl_parser_extras.h:35:
In file included from ../../../src/glsl/glsl_symbol_table.h:34:
In file included from ../../../src/glsl/ir.h:33:
In file included from ../../../src/glsl/glsl_types.h:31:
../../../src/mesa/main/mtypes.h:3420:4: error: unknown type name 'GLDEBUGPROCARB'
   GLDEBUGPROCARB Callback;
   ^
1 error generated.
gmake[5]: *** [glsl_lexer.lo] Error 1
gmake[5]: Leaving directory `/usr/ports/graphics/dri/work/Mesa-9.1.6/src/glsl/builtin_compiler'
gmake[4]: *** [all-recursive] Error 1
gmake[4]: Leaving directory `/usr/ports/graphics/dri/work/Mesa-9.1.6/src/glsl'
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory `/usr/ports/graphics/dri/work/Mesa-9.1.6/src/glsl'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/usr/ports/graphics/dri/work/Mesa-9.1.6/src'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/ports/graphics/dri/work/Mesa-9.1.6'
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/dri

===>>> make failed for graphics/dri
===>>> Aborting update

===>>> Update for dri-7.6.1_3,2 failed
===>>> Aborting update

===>>> Killing background jobs
```


----------



## Juanitou (Nov 10, 2013)

Deleting the packages graphics/dri and graphics/libGL, rebuilding them from the experimental repository and rebuilding x11-servers/xorg-server resolved this error here. It is, by the way, the reply from Mr Pédron to you (I guess) on the freebsd-stable list which gave me the solution.

My conclusion is that you must strictly follow the instructions on the AMD GPU page: Build everything from the ports with new X.Org enabled, test if it works, delete the concerned packages, use Subversion to get the experimental ports, rebuild them.


----------



## free-and-bsd (Dec 17, 2013)

Thank you for this VERY interesting and helpful tutorial. I've grabbed a couple of ideas for myself, too.

The sysutils/automount, though, doesn't impress me much: it can't automount my simple USB flash drive which I mount without any problems whatsoever using the standard mount command `#mount_msdosfs /dev/da4s1 /mnt/point`. It says it supports FAT, exFAT, NTFS etc., but the system recognizes flash drives as msdosfs and automount says:

```
2013-12-18 01:40:46 /dev/da4: filesystem not supported or no filesystem
```

Otherwise the tutorial is VERY useful, thank you very much.


----------



## JakDaRippa (Dec 31, 2013)

*T*his should be in the handbook. *T*han*ks*!


----------



## vermaden (Dec 31, 2013)

free-and-bsd said:
			
		

> The sysutils/automount, though, doesn't impress me much: it can't automount my simple USB flash drive which I mount without any problems whatsoever using the standard mount command `#mount_msdosfs /dev/da4s1 /mnt/point`. It says it supports FAT, exFAT, NTFS etc., but the system recognizes flash drives as msdosfs and automount says:
> 
> ```
> 2013-12-18 01:40:46 /dev/da4: filesystem not supported or no filesystem
> ```



Use THIS one as /usr/local/etc/devd/automount_devd.conf file:

```
notify 100 {
  match "system" "DEVFS";
  match "type" "CREATE";
  match "cdev" "(da|mmcsd)[0-9]+.*";
  action "/usr/local/sbin/automount $cdev attach";
};

notify 100 {
  match "system" "DEVFS";
  match "type" "DESTROY";
  match "cdev" "(da|mmcsd)[0-9]+.*";
  action "/usr/local/sbin/automount $cdev detach";
};
```

There was a bug in devd(8) that recognized all subpartitions/slices with "(da|mmcsd)[0-9]+" hence the default configuration file.

Now this is needed  "(da|mmcsd)[0-9]+*.**" to cover all partitions and slices.



> ```
> 2013-12-18 01:40:46 /dev/da4: filesystem not supported or no filesystem
> ```


The message in the/var/log/automount.log is valid, but there probably is a filesystem at /dev/da4s1 or other partition/slice.

I need to update this port with this new configuration, but lack of time does not help


----------



## free-and-bsd (Dec 31, 2013)

Thanks for your reply, I'll try it out . Meantime I've got used to (like in them good old times) manually mounting the stuff, but of course, it is my determination usually to test a program to the end before I give up on it.

For example, I'm quite satisfied using devd instead of hal with Xorg -- it works perfectly well and I'm glad, because I've grown tired from Linux and its complications. There used to be problems with USB keyboard and mouse some 2 years ago, but now all works smoothly.

However, I've noticed it configuring GNOME for (HAL) automount, that the only successful way to mount a USB flash drive was to engage `mount_msdosfs` and not `mount_vfat`. So this was the way I naturally understood the refusal of automount to mount my USB FLASH drives (I have a few and tried them all) because MSDOSFS is nowhere mentioned among the supported filesystems.

So I'll try it and report back. Thanks again!!


----------



## free-and-bsd (Dec 31, 2013)

Well, still doesn't work with the configuration file you suggested, gives off the same error in log file.


----------



## vermaden (Dec 31, 2013)

free-and-bsd said:
			
		

> Well, still doesn't work with the config file you suggested, gives off the same error in log file.



Assuming that this device is /dev/da4 could You sent me here the output of that command:

```
# find /dev/da4* | xargs file -s
```


----------



## free-and-bsd (Jan 1, 2014)

Here:

```
/dev/da4:   x86 boot sector; partition 1: ID=0xb, starthead 0, startsector 32, 15633376 sectors, extended partition table (last)\011, code offset 0x0
/dev/da4s1: x86 boot sector, code offset 0x0, OEM-ID "        ", sectors/cluster 32, Media descriptor 0xf8, heads 255, hidden sectors 32, sectors 15633376 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 3815, reserved3 0x1800000, reserved 0x1, serial number 0xe8498bad, unlabeled
```


----------



## free-and-bsd (Jan 1, 2014)

BTW, @vermaden, why can't we put those lines into /etc/devd.conf directly and have devd handle it?


----------



## free-and-bsd (Jan 1, 2014)

All right, that fixed it indeed ! 
Put your lines into /etc/devd.conf, along with USERUMOUNT and REMOVEDIRS set to "YES" into /usr/local/etc/automount.conf and it works now. Thanks a lot! 

EDIT: Tried to put the automount_devd.conf into /etc/devd rather than put the lines directly into /etc/devd.conf and it DOESN'T work, the same error message appears. Looks like devd only recognizes it when it's in /etc/devd.conf.

BTW, it proves easier than the GNOME & HAL way. The latter took me much more trouble to make it work, and even now sometimes doesn't work.


----------



## free-and-bsd (Jan 24, 2014)

*PCmanFM & Co*

I thank you again, @taz , for your nice howto. 

It eventually pushed me in a certain direction, so now I've ended up using TWM as it's MOST minimalistic. With Graham's configuration it even looks pretty elegant, I'm only missing the option to switch windows focus using Alt+Tab...
A couple of things I added to the minimalistic setup you've described:
1. PCmanFM is excellent, but in order for things to look nice i've installed icon themes etc. Without them you only have file names in the file manager window, not cool. Then icon stuff requires some of these ports like misc/shared-mime-info, graphics/gtk-update-icon-cache etc. I know, you mentioned you didn't want GTK...
2. Adding devel/gvfs and devel/gamin enables PCmanFM to see CIFS network shares, which is something I really need in all installations. So to make it work it only proved necessary to install these two (gvfs, gamin) in addition to x11-fm/pcmanfm itself, then make sure to start pcmanfm using command `dbus-launch pcmanfm &`. Yes, some of the dependencies somewhere installed dbus anyway...
3. Of course, I had to keep watchful to not accidentally enable HAL somewhere in dependencies (at least because my Xorg was compiled without it, so why pull it in again?).
4. Unfortunately, I can't test the effectiveness of this minimal install of mine (RAM and CPU usage), since I've just upgraded my computer to something rather powerful... But in any case, I recently grew tired of these full DE's like GNOME, regardless of how powerful the system may be. And manual installation/configuration of a custom minimal (well, comparably so) X-based system with all the necessary things proves to be VERY instructive in the way of learning how things work.
5. It's a pity Epiphany web browser, although being "extremely lightweight", pulls is the whole gnome desktop as dependency. What are they thinking about?? And Midori proved to be somewhat unstable: for some inexplicable reasons it may start up the window or... it may not and just keep running as a process. The only solution proved to be to start it in private mode, in which it is not much use as it doesn't open links and tabs... So I finally "compromised" by installing Firefox, which in turn insisted on compiling pulseaudio, which gives no sound anyway . 
But in the way of having multiple dependencies, I've noticed most desktop applications like web-browsers and file managers all need some basic set of dependencies like docbook*, vala etc., 20-40 in number.


----------



## free-and-bsd (Jan 29, 2014)

*Re: Didn't work in FreeBSD10-**



			
				zennybsd said:
			
		

> Nice tutorial, but this failed to work both with legacy xorg-server as well as new xorg in FreeBSD10-*.
> 
> `portmaster x11-severs/xorg-server` yields an intermittent error:
> 
> ...


Is it working now? At the time of your posting your problem the solution was, I think, to use a SVN code. But now it's all working fine, I've just recompiled it with new 10.0-RELEASE.


----------



## rhish (Feb 7, 2014)

These How-to tutorials are Great! Thank's taz for writing it. Found lots of good information and ideas. Wish people would write more How-to's like this for different scenario's. i.e. How-to Simple File Server, How-to Blog Hosting Server, etc etc, whatever people are interested in, and dont mind sharing.

Thanks again!


----------



## mj12net (Apr 11, 2014)

I just got this tutorial to work fine and had a question about mplayer.  I've noticed if you right click on openbox and select Mplayer from the menu, it opens the GUI but if I try to place a launcher in WBar, the GUI doesn't load.  Any way to fix that?


----------



## free-and-bsd (Apr 11, 2014)

Maybe you check the command line options for MPlayer which you place in your WBar launcher.


----------



## mj12net (Apr 12, 2014)

free-and-bsd said:
			
		

> Maybe you check the command line options for MPlayer which you place in your WBar launcher.



Yep, it's `gmplayer`.


----------



## free-and-bsd (Apr 12, 2014)

I mean, which command is there in your Openbox menu configuration for launching mplayer? Use the same for your WBar launcher.


----------



## mj12net (Apr 12, 2014)

free-and-bsd said:
			
		

> I mean, which command is there in your openbox menu config for launching mplayer? Use the same for you WBar launcher.



It was `gmplayer` also.  Thought it was simply `mplayer`.


----------



## mj12net (May 1, 2014)

*Re:*



			
				taz said:
			
		

> Screenshot
> 
> You can take a screenshot with imlib2 like this:
> 
> `$ imlib2_grab myBSD.png`



Is there a way to have the date in the filename?


----------



## Beastie (May 1, 2014)

^ Sure, a pair of grave accents "*``*" does something called "command substitution" or "inline execution", e.g.:
`<your command here> screenshot_`date "+%d.%m.%Y"`.png`


----------



## thisalone (May 23, 2014)

I'm a long time lurker here and registered just so I could thank you for this guide! Got a slick Openbox desktop running with your help running FreeBSD 10 on amd64. One thing I might add is installing Conky, it doesn't take up much memory and looks nice on the desktop for displaying system info and resources.


----------



## nydn (Jun 11, 2014)

Hello @taz and everyone!

First of all: thanks for this great guide, it really helped me a lot!

I'm a *BSD newbie, moved from Win7 to FreeBSD two weeks ago and actually I haven't even booted into Windows since then (I'm still surprised about that, because I have tried various Linux distros before but could not get used to any of them). Anyway, I tried to follow your guide, integrated some more ports and got a really nice system!

However since I've added x11/slim as a login manager I cannot use the `shutdown` command from Openbox as a normal user anymore (it worked perfectly before). Is it possible to make it work again somehow?

Regards,
Daniel


----------



## tzoi516 (Jun 12, 2014)

Since I refer to this frequently for various reasons, I've decided to update a few parts, starting with this one:
[DISCLAIMER: I didn't write any of this, just edited it for the new BB code (read: I'm not the author, @taz is). I left the quotes out for readability]
*Table of contents*
*---[ Intro*
*---[ Desktop usage on FreeBSD*
*---[ Objective*
*---[ Getting started - ports and packages*
*---[ Xorg and basic desktop*
*------[ Xorg*
*------[ Window manager*
*------[ Panel*
*------[ Launching applications*
*------[ Setting wallpaper and viewing images*
*------[ Terminal emulator*
*------[ Auto mounting*
*------[ Starting X*
*---[ Userland applications*
*------[ Browser*
*------[ Editor/IDE*
*------[ File Manager*
*------[ Video and audio player*
*------[ PDF Reader*
*------[ Torrent client*
*------[ Wireless network manager*
*------[ Network file sharing*
*------[ VirtualBox*
*---[ Misc *
*---[ Outro*


*---[ Intro*

Three years back I was starting to become seriously unhappy with Windows and started to look for an alternative. My biggest problems were the fact that I did not have full control over my OS, closed source philosophy and "millions" of applications/libraries I did not want to have on my system.

The choice came down to FreeBSD and GNU/Linux. After browsing the Internet for a weak or so I decided to go with FreeBSD because I wanted a UNIX system and back then FreeBSD seemed to be "more of a pure UNIX" then Linux.

Nowadays I use FreeBSD because of these reasons:


FreeBSD flows the UNIX philosophy: "Write programs that do one thing and do it well"
FreeBSD is almost fully POSIX compliant
FreeBSD code is clean
FreeBSD Handbook
FreeBSD gets the job done.
FreeBSD is virus free.
BSD license
...and so much more but these are the highlights.

The focus of this "howto" is desktop usage on FreeBSD but I would just like to say that three years back FreeBSD was an "alternative" for me and now everything else is the "alternative".
Also I would like to say thanks to FreeBSD developers for creating such a beautiful piece of software.

*---[ Desktop usage on FreeBSD*

After deciding that FreeBSD was going to be my new primary OS the question was "how to set it up for desktop usage?". FreeBSD handbook helped me with this a lot in the beginning. But if you follow the handbook you will probably end up with GNOME or KDE desktop environment and this "how to" is about minimal but functional desktop on FreeBSD.

Fact is that FreeBSD is more than capable of being a desktop OS the only question is what are your own preferences/requests. Mine were: minimalism, functionality, speed, low memory footprint and avoiding linuxisms.

In general, if you want to use FreeBSD as a desktop you have two ways of doing that:

1) installing a desktop environment (DE) like x11/gnome2, x11/kde4, x11-wm/xfce4, x11-wm/enlightenment , x11/lxde-meta

I have been down this road when I first started and I was not happy. I ended up with the same problem I had on Windows. Bunch of applications I did not use, high memory footprint , eye candy that has no functionality apart from eating memory for no good reason, etc.

I have actually tried all of these ports and the only one that comes into consideration IMHO, as far as minimalism goes, is x11/lxde-meta. But this "how to" is not about DE so I will not go any further into this option.

2) building your desktop from ground up with ports your only want

Now we are in business. IMHO this path is the "true" path because you will have a fully functional desktop set up the way YOU want it and you will gain so much experience and knowledge that would be simply skipped with the first path.

Do not get me wrong, althoughgh this is the "true" path it is not the easy one. It took me a lot of time to figure things out and to set up my desktop just the way I want it. I have installed and reinstalled FreeBSD so many times because I was experimenting with different ports. Now I have a shell script that installs and sets up my desktop with almost zero human interaction.

This "how to" is so that you would not need to experiment as much as I did (but you will have to experiment to a certain degree). I will present my findings over the years, ports I have settled on and alternatives to thees ports, useful readings and so on. By the end of this "howto" a FreeBSD newcomer should get the general idea of what it means and what is necessary to set up a desktop from grand up.

I will assume that you have in fact successfully installed FreeBSD and you just logged in for the first time with you user name.

If you are looking for some help on how to install FreeBSD refer to the handbook's section Installing FreeBSD 9.X and Later.

Reading the whole Getting Started section in the handbook is a MUST and I will assume that you have read it. Do not install anything but read it.

*---[ Objective*

Apart from preferences I have mentioned before we will try to avoid as much as possible the following things:


ports that require lots of dependency's
ports that depend on x11-toolkits/gtk20
ports that depend on devel/qt4

and depending on your choices for certain ports it is possible to build a "pure CLI" desktop without x11-toolkits/gtk20 or devel/qt4.

At the end we will be able to:


browse the internet
manage our files and folders with a file manager
edit our files with an editor
play movies and music
download torrents
auto mount USB drives (including NTFS formatted drives with read/write operations)
read pdf files
view images
manage our wireless connection
share files with FreeBSD/Linux/Windows
emulate another OS for anything else we do not want to/can not have on our FreeBSD system but is needed.

What more do you need, eh? 

*---[ Getting started - ports and packages*

Assuming you have read the handbook's section on ports and packages I am just going to say that we are going to use ports and compile everything from source. Reason is that we need to be able to "turn off" features and that can not be accomplished via packages since they are precompiled.

Before anything we need to update our ports tree so run this commands if you don't have the ports tree installed:

`portsnap fetch`
`portsnap extract`
`portsnap update`

run this command later on when you wish to update the installed ports tree:

`portsnap fetch update`

Now we need to decide how are we going to manage our ports. ports-mgmt/portmaster is a great tool that dose not require external databases or languages so we will use that.

Install the port:

`cd /usr/ports/ports-mgmt/portmaster/ && make install clean`

Sample configuration file for portmaster si located at /usr/local/etc/portmaster.rc.sample. Copy it to /usr/local/etc/portmaster.rc and set the options you like:

`cp /usr/local/etc/portmaster.rc.sample /usr/local/etc/portmaster.rc`
`ee /usr/local/etc/portmaster.rc`

ee(1) stands for "easy editor" and comes with FreeBSD. It is very simple to use and perfect for editing configuration files form command line. Another option would be VI(1) if you are familiar with it.

I have enabled thees options but for more information you can refer to the man page PORTMASTER(8)


----------



## tzoi516 (Jun 12, 2014)

Since I refer to this frequently for various reasons, I've decided to update a few parts:
[DISCLAIMER: I didn't write any of this, just edited it for the new BB code (read: I'm not the author, @taz is). I left the quotes out for readability]

```
# Always delete stale distfiles without prompting (-d)
ALWAYS_SCRUB_DISTFILES=dopt
# Be verbose (-v)
PM_VERBOSE=vopt
# Install packages for build-only dependencies (--packages-build)
PM_PACKAGES_BUILD=pmp_build
# Delete build-only dependencies when finished (--delete-build-only)
PM_DEL_BUILD_ONLY=pm_dbo
#Suppress the build confirmation message (--no-confirm)
PM_NO_CONFIRM=pm_no_confirm
```

From now on we will use portmaster for managing ports.

And here are some commands you might find useful:


```
upadate all ports:

	portmaster -a 
	force:
		portmaster -af
	
search for updates and list all installed ports by category:
		
	portmaster -L
	portmaster -L | grep "New version available:"
		
clean stale distfiles:

	portmaster --clean-distfiles
	with out promt:
		portmaster --clean-distfiles-all
	
uninstall the port and it's dependencies:
	
	portmaster -e target_port

rebuild the specified port, and all ports that depend on it:
	
	portmaster -r target_port
```

*---[ Xorg and basic desktop*

*Xorg*

x11/xorg is a meta port for all the X.Org ports but we will install just the ones we need. You could just install the meta port and it would not make much of a difference but I like perfection so things like this get to me . There is also x11/xorg-minimal and you can also use that too instead of compiling individual ports.

First install x11-servers/xorg-server:

`portmaster x11-servers/xorg-server`

*Important: disable HAL option!*

sysutils/hal is usually used for auto mounting but we will use FreeBSD's DEVD(8) since hal is linuxisms.

Also disable hal in all other ports that might have HAL option.

Next install x11-drivers/xorg-drivers for mouse, keyboard and your video card:

`portmaster x11-drivers/xorg-drivers`

Make sure MOUSE and KEYBOARD options are selected and select the video driver for your video card. You might also want to select VESA option just in case. Disable every thing else.
If you have an nvidia card use this port for video drivers instead of Xorg's: x11/nvidia-driver. But make sure you disable LINUX option for this port and all others that might have such an option.

Next install x11/xinit, x11/xauth, x11-fonts/xorg-fonts and x11-fonts/webfonts

`portmaster x11/xinit`
`portmaster x11/xauth`
`portmaster x11-fonts/xorg-fonts`
`portmaster x11-fonts/webfonts`

Next we need to configure Xorg so run this command:

`Xorg -configure`

This will create a new configuration file which needs to be copied to Xorg folder:

`cp /root/xorg.conf.new /etc/X11/xorg.conf`

Edit the file to set your keyboard layout and resolution. For keyboard layout add " Option "XkbLayout" "<your_layout>" " line to "InputDevice" section:


```
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbLayout" "hr"
EndSection
```

And for resolution add "Modes "1366x768"" line to "Screen" section. If you have multiple depth's just delete them and leave the "Depth 24".


```
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1366x768"
EndSubSection
EndSection
```

If you are using nvidia-driver install x11/nvidia-xconfig:

`portmaster x11/nvidia-xconfig`

and run:

`nvidia-xconfig`
`echo "nvidia_load=\"YES\"" >> /boot/loader.conf`

This will create a new xorg.conf file or edit an existing one. The second command will load nvidia-driver kernel module at start up.

And finally enable MOUSED(8) for mouse support.

`echo "moused_port=\"/dev/psm0\"" >> /etc/rc.conf`
`echo "moused_enable=\"YES\"" >> /etc/rc.conf`

We could now reboot and start our first Xorg session but there is not much of a point since we do not have anything else installed so we are proceeding to window managers.

*Window manager*

This is where experimenting starts. There are many window managers (WM) and finding the one that suits your needs can be time consuming. I will list the ones that are most commonly used and how to setup the one I personally use.

The first window manager I tred was x11-wm/fluxbox but swiched to x11-wm/openbox because openbox is written in C where fluxbox is written in C++ and because with openbox you just get a window manager where with fluxbox you get a window manager and a built in panel which I did not like. Openbox is configured via xml syntax which might be a little confusing but once you configure it you most likely won't need to change it ever again.

If you do not like openbox there are plenty of other windows managers out there. I will list here the ones that people seam to be using the most but trust me there are PLENTY of others.

Here is a list of most common ones:

x11-wm/openbox
x11-wm/fluxbox
x11-wm/dwm
x11-wm/twm
x11-wm/windowmaker
x11-wm/fvwm
x11-wm/ratpoison
x11-wm/icewm
x11-wm/awesome, this is a a tiling window manager which means non-overlapping frames.
x11-wm/spectrwm, another tiling wm

Now lets setup the one I use and that would be x11-wm/openbox.

First install the port:

`portmaster x11-wm/openbox`

Next is configuration (make sure you are not executing thees commands as root):

`mkdir ~/.config`
`mkdir ~/.config/openbox`
`cp /usr/local/etc/xdg/openbox/menu.xml ~/.config/openbox/menu.xml`
`cp /usr/local/etc/xdg/openbox/rc.xml ~/.config/openbox/rc.xml`
`touch ~/.config/openbox/autostart.sh && chmod +x ~/.config/openbox/autostart.sh`
`echo "#!/bin/sh" >> ~/.config/openbox/autostart.sh`

This will create the openbox configuration folder for your account and copy configuration files to it. 
~/.config/openbox/autostart.sh is a script that will be executed every time you start openbox. 
~/.config/openbox/menu.xml is the configuration file for openbox menu which will be visible when you press the right mouse button on the desktop.
~/.config/openbox/rc.xml is the configuration file for openbox itself. 

For now we will leave it at default settings but further information on configuring openbox can be found here.

Finlay we need to tell Xorg to use openbox:

`echo "exec openbox-session" >> ~/.xinitrc`

*Panel*

The window manager will take care of our windows but we need some place to hold them when we minimize our windows and I will present two panels. One depends on gtk and the other one dose not. 

First one is x11/tint and it depends on gtk.

Install the port (and make sure you disable PYCONF option):

`portmaster x11/tint`

Configuration:

`echo "(sleep 2 && tint2) &" >> ~/.config/openbox/autostart.sh`
`mkdir ~/.config/tint2`
`cp /usr/local/share/examples/tint2/tint2rc ~/.config/tint2/tint2rc`

This will launch tint when openbox starts and copy the example configuration file to home directory. Later on you can edit that file to suit your needs. How to do that is explained here.

If you are using openbox find these lines in the ~/.config/openbox/rc.xml file:


```
<margins>
<top>0</top>
<bottom>30</bottom>
<left>0</left>
<right>0</right>
</margins>
```

Bottom height should be the same as tint's height, not 0. This will prevent windows to overlap tint when maximized.

Second one is deskutils/pypanel and it dose not depend on gtk nor qt.

Install the port:

`portmaster deskutils/pypanel`

Configuration:

`echo "(sleep 2 && pypanel) &" >> ~/.config/openbox/autostart.sh`

This will launch pypanel when openbox starts and the first time pypanel is launched it will create a default configuration file ~/.pypanelrc. Later on you can edit that file to suit your needs. The configuration file is well commented and configuration is fairly straightforward.

You might want to change the button event handler a little bit, though.

Find this lines:

```
if button == 1:
pp.taskFocus(task)
```

and put this:

```
if button == 1:
pp.taskFocus(task)
pp.taskFocus(task)
```

this will maximize the window and put focus on it with one mouse click.


----------



## tzoi516 (Jun 12, 2014)

Since I refer to this frequently for various reasons, I've decided to update a few parts:
[DISCLAIMER: I didn't write any of this, just edited it for the new BB code (read: I'm not the author, @taz is). I left the quotes out for readability]

*Launching applications*

We already have the possibility of launching applications via openbox's menu but I like to use a quick launch bar for this task. x11/wbar is a light quick launch bar and looks really slick. It depends on gtk though, so you might want to skip this part and configure ~/.config/openbox/menu.xml file for quick launch. Also pypanel has a built in appliation launcher.

Install the port (and make sure you disable WBARCONFIG option):

`portmaster x11/wbar`

Configuration:

Start wbar on openbox startup:

`echo "(sleep 2 && wbar) &" >> ~/.config/openbox/autostart.sh`

This will launch wbar when openbox starts and the first time wbar is launched it will create a default configuration file ~/.wbar. Later on you can edit that file to suit your needs. Configuration is fairly straightforward. You just have to specify the path to icon, command and text to be displayed.

Example:

```
i: /usr/local/share/pixmaps/wbar/terminal.png
c: urxvtc 
t: urxvtc

i: /usr/local/share/pixmaps/wbar/music.png
c: urxvt -e mplayer -playlist ~/tera1/Music/RadioStream/soulful.pls
t: soulful
```

A nice trick with launching terminal based applications is the terminals "-e" option. With it you can launch a terminal window and make it to immediately run a command specified behind the "-e" switch. That way you don't have to first launch the terminal and then type in the command.

*Setting wallpaper and viewing images*

For viewing images I have chosen graphics/feh and we can use it to set wallpaper to, which is neat.

Install the port:

`portmaster graphics/feh`

Configuration:

`echo "feh --bg-scale ~/path/to/wallpaper.jpg &" >> ~/.config/openbox/autostart.sh`

This will set the wallpaper each time you start openbox. You probably don't have any pictures yet on your system so you can FETCH(1) this nice FreeBSD wallpaper and set it up.

`cd ~/.config/openbox/`
`fetch [url]http://www.bsdnexus.com/wallpapers/DD_freebsd.jpg[/url]`
`echo "feh --bg-scale DD_freebsd.jpg &" >> autostart.sh`

And if you want to view images just run feh form the command line and make sure you are positioned in the folder you want to view images:

`feh -t`

Extra reading can be found here.

*Terminal emulator*

Choosing the right terminal emulator is really important since you will be spending a lot of time using it. So you want to choose the one you are comfortable with. I will list the ones I have tried, reasons why I switched to another one and explain how to setup the one I settled with.

These are the one I have tried:

x11/sterm -> single binary, simple and minimal, no tabs.
x11/xterm -> used it for a long time but it has no support for tabs
x11/roxterm -> depends on gtk
x11/aterm
x11/eterm
x11/rxvt-unicode -> the one I use

x11/rxvt-unicode is realy neat. It supports tabs via perl extension, stores text in unicode, has transparency if you want that slick look, configurable via ~/.Xdefaults file, lightweight, fast, deamon/client mod and most importantly it just works.

So if you want to try x11/rxvt-unicode here s how you set it up.

Install the port (default options are ok):

`portmaster x11/rxvt-unicode`

Configuration:

Configuration is done via ~/.Xdefaults. Here is a nice reading on how to configure it.

I personally like the solarized colors so I have adapted this ~/.Xdefaults and and modified it to my needs.

I suggest running urxvt in deamon/client mode for faster performance and lower memoy footprint so run urxvtd at startup:

`$ echo "urxvtd -q -f -o" >> ~/.config/openbox/autostart.sh`

and then use:

`$ urxvtc`.

You can copy/paste via middle mouse button. Just select the text in terminal or other application and it will be "copied". To paste it, either to terminal or other application, press the middle button or both left and right mouse buttons simultaneously if you don't have a middle button.

A better solution is a perl plugin you can found here. You will need x11/xclip for it to work and the path for urxvt perl plugins on FreeBSD is /usr/local/lib/urxvt/perl/. How to set it up is described at the provided link.

If you don't want to use tabs to have multiple terminals in one window, take a look at sysutils/tmux which is a terminal multiplexer.

*Auto mounting*

As mentioned before we will not use hal but FreeBSD's DEVD(8) wich stand for "device state change daemon".

There is a script that wrapps around DEVD(8) and dose the mounting for us: sysutils/automount.

Install the port:

`portmaster sysutils/automount`

Configuration is done via /usr/local/etc/automount.conf and you can run this command to see what options you have:

`automount --help`

I just use this option in my /usr/local/etc/automount.conf file:

```
REMOVEDIRS="YES"
```

If you want to mount NTFS formatted drives with read/write operations you will need to install sysutils/fusefs-ntfs.

Install the port:

`portmaster sysutils/fusefs-ntfs`

Configuration:

`cp /usr/local/modules/fuse.ko /boot/modules/`
`echo "fuse_load=\"YES\"" >> /boot/loader.conf`

This will load the kernel module on start up and automount will recognise that you have installed fusefs-ntfs and will use it for NTFS formatted drives.

If you want to auto mount a IDE/SATA hard drive connected to your mother board check this thread out.

In case you are wondering how to use it by hand here is the command you can issue to mount NTFS drives:

`ntfs-3g /dev/da*s1 /mnt`

Run this command to find out what number to repalce "*" with:

`dmesg`

*Starting X*

Now we should be ready to start our first Xorg session. But first lets reboot the system:

`shutdown -r now`

If you want to power down use this command:

`shutdown -p now`

And if you want to be able to reboot or power down from openbox without being root you should add your user name to the operator group:

`pw groupmod operator -m user_name`

Before we actually start Xorg make sure you can run your terminal emulator either from wbar or from openbox's menu! By now you should be able to know how to do that.

Once you have logged in with your user name run this command to start Xorg:

`startx`

If everything went well and you have chosen to use openbox with tint and wbar you should be seeing something like this:



If you are not seeing something like this that means something went wrong and you will have to fix the problems you have. My suggestion is to FIRST search google for answers and if that dose not work THEN post here for help.


----------



## tzoi516 (Jun 12, 2014)

Since I refer to this frequently for various reasons, I've decided to update a few parts:
[DISCLAIMER: I didn't write any of this, just edited it for the new BB code (read: I'm not the author, @taz is). I left the quotes out for readability]

*---[ Userland applications*

Now we will proceed to common applications used by a desktop user. And we will start with a browser.

*Browser*

By now you should know how to install ports so I will stop posting the install command. Also I hope you are able to run your virtual terminal from Xorg .

Back to our browser. There is realy only one option IF you want to avoid gtk and qt which would be www/opera. VIDEO option is enabled by default and leave it at that if you want HTML5 video support. With it you will be able to view, currently, some YouTube videos.

With opera we can avoid gtk and qt but opera dose not really follow the "do one thing and do it well" philosophy. Do not get me wrong I use opera and it's great. They release a package for FreeBSD systems and really care about FreeBSD users. But comes with a built in email client, torrent client, etc. 

Flash is currently supported on FreeBSD via Linux kernel module and we are trying to avoiding linuxisms remember . In my opinion HTML5 will overcome Flash so I'm sticking with opera and HTML5. But here is how you do it if Flash is a "deal breaker".

Another solution for Flash would be www/youtube_dl. You can use this simple script to stream YouTube (and other popular video streaming sites like Vimeo) videos (requiers mplayer but we will get to that):


```
#!/bin/sh
#usage: ./this_script.sh "url"

COOKIE_FILE=/var/tmp/youtube-dl-cookies.txt
mplayer -cookies -cookies-file ${COOKIE_FILE} $(youtube-dl -g --cookies ${COOKIE_FILE} $*)
```

Use this command to download the video:

`youtube-dl "http://www.youtube.com/watch?v={video_id}`

Other popular browser like www/firefox, www/chromium, www/seamonkey are also available.

If you don't care about gtk that much and want minimalism with security I would suggest you check out www/xombrero.

And if you don't care about JavaScript check out www/links and www/dillo2. You can run links in a terminal or if you enabled X11 option you can run it like this:

`links -g`

*Editor/IDE*

Ah editor...such an important segment on UNIX like systems. For me it comes down to two options. One depends on gtk and the other one dose not.

First is devel/geany and I absolutely love it. It's actually a small IDE and I use it for all of my programming projects. The other one is editors/vim and it's THE editor among UNIX like systems. Vim is console based and once you learn , yes learn, how to use it it can become a very powerful tool/editor/IDE.

If you are going to try vim and you don't want the gtk front end called gvim make sure you pass this to make:


```
WITH_X11_ONLY=YES
```

this will compile vim with out the gui front end but will enable some other useful X11 features like the clipboard so you can copy/paste from other windows.

example for portmaster:

`portmaster -m WITH_X11_ONLY=YES editors/vim`

Configuration file is ~/.vimrc. Browse the Internet on how to setup vim but I suggest you start with this example vimrc file. 

I myself am in the process of completely switching to vim but I got so used to geany that it's not such a simple task.

I guess I should mention editors/emacs, but that is all I'm going to do.

*File Manager*

For a X11 based fm I suggest x11-fm/xfe. It dose not depend on gtk nor qt and it's awsome!

For a console based file manager I suggest misc/mc. You will have to get used to it, though.

Another option is to simply use your virtual terminal for file managing. This is what I do and I got quite used to it. Most of the time you just use cd, cp, rm, mv and mkdir commands anyway. And with a shell like shells/zsh and auto completion you can manage your files quite fast.

*Video and audio player*

For playing video multimedia/mplayer, IMHO, is the authority among UNIX like systems. If you don't want a gtk front end make sure you disable the GUI option.

To play video with mplayer use this command:

`mplayer /path/to/video/file/example.avi`

mplayer has lots of options and I strongly suggest you check out the documentation.

But here are the keys I use the most:

```
9 - volume -
0 - volume +
f - toggle full screen
p - pause/resume
q - quit
```

nvidia-driver users might want to take a look at this.

multimedia/vlc is also available and by default it will compile with a qt frontend. You can disable that option, if you don't want qt and enable the ncurses console interface.

You can play your audio with mplayer or vlc but if you want a separate port for that check out audio/moc for a console audio player. And multimedia/audacious for a Winamp like audio player with a gtk front end.

To run moc use this command:

`mocp`

*PDF Reader*

For a pdf reader I have choosen graphics/mupdf. It's quite lightweight and fast.

Another lightweight option would be graphics/xpdf.

*Torrent client*

For a console based torrent client net-p2p/rtorrent is an excellent choice.

Sample configuration file is /usr/local/share/examples/rtorrent/rtorrent.rc, copy it to ~/.rtorrent.rc

`cp /usr/local/share/examples/rtorrent/rtorrent.rc ~/.rtorrent.rc`

Configuration is fairly straight forward and here is a nice reading on how to do that.

For a torrent client that has a gtk or qt frontend check out transmission.

You could install net-p2p/transmission-daemon and set it up as a deamon which can then be acsessed via web browser or transmission-remote. I used to do that but that was more of a work around since net-p2p/rtorrent was missing some functionalities like magnet links.

Also, www/opera has a built in torrent client.

*Wireless network manager*

net-mgmt/wifimgr is a great tool for managing your wifi connections on your laptop but it depends on gtk. It's actualy just a front end for FreeBSD's WPA_SUPPLICANT(8) so technically you don't need it.

I really like it and was actually thinking of porting the code to an ncurses front end. That would be so sweet


----------



## tzoi516 (Jun 12, 2014)

Since I refer to this frequently for various reasons, I've decided to update a few parts:
[DISCLAIMER: I didn't write any of this, just edited it for the new BB code (read: I'm not the author, @taz is). I left the quotes out for readability]

*Network file sharing*

If you want to be able to share files between your FreeBSD system and FreeBSD/Linux/Windows net/samba36 is the answer.

I would suggest you disable all options expect for maybe IPV6 support. Because most likely you do not need them and if you do you will know what to enable.
After you have installed samba set the password for your user name:

`smbpasswd -a user_name`

With this user name and password you will authenticate yourself before accessing the share.

Now if you want to share something on your FreeBSD system create the samba configuration file (a template can be found here /usr/local/etc/smb.conf.default)

`ee /usr/local/etc/smb.conf`

and put this in it:


```
[global]
workgroup = WORKGROUP
server string = FreeBSD Samba server
netbios name = server_name
security = user
encrypt passwords = yes
#hosts allow = 127.0.0.1 192.168.1.0/24
#hosts deny = 0.0.0.0/0
socket options = TCP_NODELAY
log level = 2
log file = /var/log/samba.log.%m
max log size = 50
debug timestamp = yes

[Media]
comment = Media Share Folder
path = /path/to/folder/you/want/to/share
read only = no
writeable = yes
```

Change the server_name and /path/to/folder/you/want/to/share to suit your needs.

If you want to access your share from a Windows machine enter this in the windows explore bar or run it via run: 

`//server_name`

If you want to mount a windows share to your FreeBSD system, where xxx.xxx.xxx.xxx is the local ip address of a Windows machine, use this:

`mount_smbfs -I xxx.xxx.xxx.xxx -N "//user_name@pc_name/share_name" /mnt`

If you want to mount another samba share to your FreeBSD system use this:

`mount_smbfs //user_name@server_name/share_name /mnt`

If you want to start the samba service at start up run this command:

`echo "samba_enable=\"YES\"" >> /etc/rc.conf`

If not you can start/stop the service like this form the terminal:

`service samba start`
`service samba stop`

For every thing else pleas refer to documentation.

*VirtualBox*

emulators/virtualbox-ose is one of my favorite application and I am so happy that FreeBSD supports it. I don't really like dual boot because I not want to have another OS on my hardware. With virtualbox-ose I can run Windows as if it was an application and every thing I don't want to have on my FreeBSD system, but need it on occasions, I just dump into virtualbox-ose and therefore keeping my FreeBSD system clean.

One thing that was bothering me constantly was the fact that it uses a qt based front end. And trust me qt is FAT! Turns out you do not need the front end and you can display the VM without the qt front end. The answer is VBoxSDL. You can read more about it here but here is a quote from the website:


```
VBoxSDL is a simple graphical user interface (GUI) that lacks the nice point-and-click support which VirtualBox, our main GUI, provides.
```

Sweet! Just what we need for our minimal desktop. And trust me it works great!

When you install virtualbox-ose make sure you disable QT4 and NLS options.

Here you can find instructions on how to set up virtualbox on FreeBSD or just run thees commands and reboot the system after:

`echo "vboxdrv_load=\"YES\"" >> /boot/loader.conf`
`echo "vboxnet_enable=\"YES\"" >> /etc/rc.conf`
`echo "devfs_system_ruleset=\"system\"" >> /etc/rc.conf`
`echo "[system=10]" >> /etc/devfs.rules`
`echo "add path 'usb/*' mode 0660 group operator" >> /etc/devfs.rules`

Creating a VM form the terminal is fairly simple, you just have to read the documentation. I'm going to post a script that creates a very basic VM and if you want to enable some options that are not enabled by the script refer to this documentation.

Here is the script:

```
#!/bin/sh

#-----------------------------------------------------------------------
#CONFIG
#-----------------------------------------------------------------------

#set dir for virtual hard disk image
hdPath=/usr/home/$USER/DATA/VBoxHD
#set virtual hard disk image in MB
hdSize=20480
#set virtual machine name
vmName="WinXp"
#set os type. Run "VBoxManage list ostypes" to list options,c/p under ID.
osType="WindowsXP"
#set path to guest ISO
guestISO="/usr/home/$USER/DATA/xp.iso"
#set RAM size
ramSize=1024
#set RAM size for GPU
gpuRamSize=128
#set network interface
nic="re0"

#create folder for virtual hard disk image
if [ ! -d $hdPath ]
then 
mkdir $hdPath
fi

#-----------------------------------------------------------------------
#CREATE
#-----------------------------------------------------------------------

#create a new virtual hard disk image.
VBoxManage createhd --filename $hdPath/$vmName.vdi --size $hdSize

#create a new XML virtual machine definition file
VBoxManage createvm --name $vmName --ostype $osType --register

#add an IDE controller with a DVD drive attached, and the install ISO inserted into the drive. Set "--medium none" to detach all.
VBoxManage storagectl $vmName --name "IDE Controller" --add ide
VBoxManage storageattach $vmName --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium $hdPath/$vmName.vdi
VBoxManage storageattach $vmName --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium $guestISO

#set boot order
VBoxManage modifyvm $vmName --boot1 dvd --boot2 disk --boot3 none --boot4 none

#set I/O APIC support
VBoxManage modifyvm $vmName --ioapic on

#set the amount of RAM
VBoxManage modifyvm $vmName --memory $ramSize

#set the amount of RAM for virtual graphics card
VBoxManage modifyvm $vmName --vram $gpuRamSize

#set network mode(briged,NAT...)
VBoxManage modifyvm $vmName --nic1 bridged --bridgeadapter1 $nic

#enable USB support
VBoxManage modifyvm $vmName --usb on

#enable sound
VBoxManage modifyvm $vmName --audio oss --audiocontroller ac97
```

Once you have created the VM, run it with this command:

`VBoxSDL --startvm VM_name --fullscreen`

Use "CRTL + F" to toggle full screen.

To get a list of all the VMs run this:

`VBoxManage list vms`

If you want the guest additions you can find them here. Download the .iso and mount it to your virtual dvd like this:

`VBoxManage storageattach $vmName --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium /path/to/iso/additions.iso`.

We have enabled USB support so if you want to "mount" your USB drives here is what you do: (and make sure the VM is running!)

Firts make sure that the drive is not mounted on FreeBSD and if it is umount it:

`umount /dev/da*`

Now list the USB devices to get UUID:

`VBoxManage list usbhost`

And attach your USB drive to your VM:

`VBoxManage controlvm VM_name usbattach UUID`

*---[ Misc *

Mount CD/DVD

Since devd dosn't have an event about inserting and removing CD/DVD from the drive you can't automount with sysutils/automount. Instead we have to mount manually for now:

`mount_cd9660 /dev/cd0 /mnt`

Screenshot

You can take a screenshot with imlib2 like this:

`imlib2_grab myBSD.png`

Or with graphics/scrot that utilizes imlib2 but has some extra options like delay.

Calculator

bc

Disable beep sound in terminal:

`echo "hw.syscons.bell=0" >> /etc/sysctl.conf`

Set UTF-8:

Edit ~/.login_conf and put this in it:


```
me:\
	:charset=UTF-8:\
	:lang=en_US.UTF-8:
```

for "lang" run this command to list avilable languages:

`locale -a`

*---[ Outro*

I hope this "howto" will be useful to someone trying to accomplish the same thing as me and to other FreeBSD beginners trying to set up a desktop environment from ground up. Comments and suggestions are more then welcome.


----------



## tzoi516 (Jun 12, 2014)

Updated posts start -->here<--


----------



## Juanitou (Jun 12, 2014)

Thank you @tzoi516!


----------



## tzoi516 (Jun 12, 2014)

:beergrin


----------



## nydn (Jun 13, 2014)

tzoi516 said:
			
		

> Updated posts start -->here<--


*T*hank you for this little update! One little thing: I think you could replace the picture at the end of 'Starting X'? Since it's not available anymore*.*


----------



## tzoi516 (Jun 13, 2014)

nydn said:
			
		

> tzoi516 said:
> 
> 
> 
> ...


Done! Thanks for catching that.


----------



## taz (Jun 16, 2014)

Thanks @tzoi516 for this. I have been meaning to do this but just could not find the time. I have put the link in the guide header. Also for all the "lovers" off this guide the "[howto] minimal FreeBSD desktop v2" should be available within a month or two.

 :beergrin


----------



## xtremystinx (Jul 17, 2014)

Thank you both, @taz and @tzoi516. I'm using a similar setup with Archbang these last few years and your guide was a very big push for me to try FreeBSD and get something familiar to start with. Thanks again!


----------



## MuTeD (Oct 27, 2014)

Fantastic guide! I basically created an account here just to show my appreciation. This "how to" pushed me over the line to try FreeBSD on an old desktop and I have since installed it on my main laptop. I even try to mimic this when installing a Linux system. Thanks!

I had a few issues though:

x11/xorg-minimal was a little too minimal. I don't think it asked me what video driver to install. All I know is that my screen was rather blurry so I just installed x11/xorg which solved the problem.
x11-wm/openbox wouldn't install with ports-mgmt/portmaster, I had to `cd /usr/ports/x11-wm/openbox && make install clean` instead and that worked fine.
Making emulators/virtualbox-ose gave errors. It required me to have both lib32 and FreeBSD's src installed.


----------



## shepper (Oct 28, 2014)

MuTeD said:


> Fantastic guide! I basically created an account here just to show my appreciation. This "how to" pushed me over the line to try FreeBSD on an old desktop and have since installed it on my main laptop. I even try to mimic this when installing a Linux system. Thanks!



This has become my favorite desktop and I have basically set it up in Debian, Fedora 20, OpenBSD and NetBSD.  In OpenBSD I went ahead and chose applications based on their stability and have put together a walkthrough install http://daemonforums.org/showthread.php?t=8489.  I tried to stay with GTK applications and collected the configuration files in ~/.config/.  There is also a link on how to create a custom x11/wbar dock.


----------



## priyadarshan (Nov 10, 2014)

taz said:


> Also for all the "lovers" off this guide the "[howto] minimal FreeBSD desktop v2" should be available within a month or two.



taz I will need to install a minimal FreeBSD desktop as soon as FreeBSD 10.1 is out (apparently in less than two weeks). Any news about the update to your very nice guide?


----------



## free-and-bsd (Jan 15, 2015)

Made a small addition to my minimal desktop (fvwm2): menu item to make a snapshot of a section of my screen.

```
#!/usr/local/bin/bash
echo "Type filename to save"
read imagename
import $imagename
echo "Screenshot saved as $imagename"
```
This file is saved as ~/printscreen

Then it can be called from the fvwm2 menu like this:

```
...
+       "Screenshot"   Exec exec xterm -geometry 30x5 ~/./printscreen
```

How it works: upon clicking the menu item "Screenshot" a small xterm window appears prompting to type the name you want your screenshot to be saved under. After typing in a name in the format filename.jpg or filename.png you select the section of the screen you want to have saved. For more details about the available graphics formats, see import(1).

PS: forgot to mention: you'll need ImageMagick for that to work.


----------



## free-and-bsd (Jan 15, 2015)

And BTW, more about how to make screenshots using ImageMagick, see this page. Arch people are very nice.


----------



## ANOKNUSA (Jan 15, 2015)

free-and-bsd said:


> And BTW, more about how to make screenshots using ImageMagick, see this page. Arch people are very nice.



If you don't need ImageMagick installed for anything else, have a look at graphics/scrot. It's tiny, and can take a screenshot of the entire display, a selection or a single window. Seems to be what most folks use make screenshots for the Arch forums.


----------



## free-and-bsd (Jan 16, 2015)

ANOKNUSA said:


> If you don't need ImageMagick installed for anything else, have a look at graphics/scrot. It's tiny, and can take a screenshot of the entire display, a selection or a single window. Seems to be what most folks use make screenshots for the Arch forums.


Yea, they talk a lot about this one. But I just happen to have ImageMagick installed (as do many, I believe) for a good deal of things, including some funny FVWM2 "look & feel" customizations.
Also, I cannot possibly tell if I won't be needing it for some other things in the future, because I enjoy finding and absorbing new ideas. And graphics/ImageMagick seems to be invented just with this approach in mind . For the same reason I use icon sets in my x11-fm/pcmanfm file manager, which also pulls in a number of desktop-related utilities. But then files have icons in the file manager window...

With this said, my idea of a "minimal" desktop finds me with some 500 packages installed, . But it remains "minimal" in that it doesn't impose upon me all these junk programs from GNOME DE, for example, which make it work slow and even prevent it from doing properly what my "limited" installation does without fail.


----------



## xripro (Feb 10, 2015)

Hi FreeBSD lovers,
I am on current r278361 and I've used this how to.
I am  facing a problem: When I launch opera I get this message:

```
Error locating 'readfile' - Shared object "libsupc++.so.1" not found, required by "libstdc++.so.6"
```
The browser seems to start up normally but it display some of the web pages that I am trying to browse.
How can I resolve this error?


----------



## tmpdmp (Mar 6, 2015)

This is my installation instruction set for a FreeBSD desktop, can someone go through it and tell me if it's fine or needs some edits?  It worked for FreeBSD 10.0 but maybe need someone to check it for 10.1


----------



## abishai (Mar 6, 2015)

1. hald is no longer required.
2. `Xorg -configure` is not required or you have to remove 90% of its generated contents. Just make xorg.conf with driver section as a hint and font path.


----------



## tmpdmp (Mar 7, 2015)

Can you be kind enough to write the commands out as I'm new to FreeBSD.


----------



## sidetone (Mar 7, 2015)

/etc/rc.conf :

```
dbus_enable="YES"
#hald_enable="YES"  #comment out this line, after FreeBSD 10.1
```
/etc/fstab :

```
devfs   /dev   devfs   rw   0   0  #This option may not be necessary
fdesc   /dev/fd   fdescfs   rw   0   0
```
I don't think the dev modules have to be loaded, since it is native to FreeBSD.
The manpage says devfs(5) and fdescfs(5) automatically mount /dev and /dev/fd , if the mounts aren't specified. devfs.conf(), devfs.rules()
If you were asking about devfs.


----------



## Andrew Gay (May 20, 2015)

*EDIT *Possible Solution
I looked at the .jpg images a few posts above and saw the *$ *for a few commands which from what I read is a regular user. The *#* means as root.

When do you switch back to the root user? (I am assuming he means just the scripts below where it says to do so then switch right back)
*
What is the last line I run as a regular user?*

Thank you for the help!


----------



## getopt (May 20, 2015)

Andrew Gay said:


> What is the last line I run as a regular user?


You need to understand when to use a root account or get root permissions with `su -`. This is usually the case when you do (base)system related work in contrast to running userland applications. Never run Xorg as root.
So when you want to install ports or you have to edit configuration files you probably need to have root permissions. Do not get used to run root all the time, only do it when it is required and this requirement is being told to you by the system when it refuses to run normal user's commands.


----------



## mcac (Oct 18, 2015)

Thank you so much for this guide. I finally was able to have a desktop with FreeBSD Current, slim login manager and Lumina-DE.


----------



## sidetone (Nov 8, 2015)

light desktop tutorial, http://freebsdwiki.net/index.php/Desktop,_light_setup


----------



## free-and-bsd (Jun 14, 2016)

Just wonder why do you guys who're not familiar with the OS need to run CURRENT and not a RELEASE? It's not exactly the best one for those willing to _try_ FreeBSD...


----------



## elmarko (Jul 11, 2016)

Taz, just like to give you my sincere thanks for the guide. i have used the setup described for a number of years and love openbox wbar tint2 etc. its a fantastic combination. The ..i use this program or i use that program is arbitrary, as the base system is absolutely wonderful. 
Once again i would like to thankyou for helping me make the switch from linux to freebsd many years ago and never look back. its order, its structure and most importantly its ports make me feel i have a complete operating system without stuffing about with repositories and garbage overload with solutions to problems faced with linux.

Marko


----------



## Lars Skogstad (Jul 20, 2016)

Thank you very much for this detailed guide. Im gonna copycat it when i get back from vacation


----------



## Phishfry (Jul 21, 2016)

free-and-bsd said:


> Just wonder why do you guys who're not familiar with the OS need to run CURRENT and not a RELEASE?


Hardware support. Many users coming from Linux are used to good hardware support so if they come here and their platform is broke they will revert back to Linux, whereas with -CURRENT at least they can learn, even if on a testing version. I agree with your sediment it is more a hardware thing I beleive.
Xorg on -CURRENT has the most hardware support, even if in development.

Maybe its the new car phenomenon.


----------



## archfan (Jul 21, 2016)

> Xorg on -CURRENT has the most hardware support, even if in development.



Huh. I thought the ports are the same for every FreeBSD version?


----------



## scottro (Jul 21, 2016)

Many hardware drivers are in the kernel.


----------



## kpa (Jul 21, 2016)

Yep, the current Xorg implementation requires that the kernel implements the KMS (kernel mode switch ) and DRM (direct rendering mode) services. This means that the actual hardware support is no longer solely dependent on the Xorg port as it used to be but also on the FreeBSD version. Without this change we would be stuck with a very ancient version of Xorg that would have no support for any of the modern video cards.


----------



## free-and-bsd (Jul 31, 2016)

Phishfry said:


> Hardware support. Many users coming from Linux are used to good hardware support so if they come here and their platform is broke they will revert back to Linux, whereas with -CURRENT at least they can learn, even if on a testing version. I agree with your sediment it is more a hardware thing I beleive.
> Xorg on -CURRENT has the most hardware support, even if in development.
> 
> Maybe its the new car phenomenon.


Ah, of course. Well, I must admit I've never run into any problems with CURRENT which I've been using on 3 machines, I think, since the time 10.1 appeared.


----------



## Phishfry (Jul 31, 2016)

free-and-bsd said:


> Ah, of course. Well, I must admit I've never run into any problems with CURRENT which I've been using on 3 machines, I think, since the time 10.1 appeared.


User Murph has wisely pointed out the possible problems of using -CURRENT  including possibly broken security features(due to development).
I would not use -CURRENT on any directly connected internet machine.
I get brave behind pfSense. Good to have layered security.
I do agree with your sediment wholeheartedly. Somebody has to test though. Who better than someone with a broken config.


----------



## free-and-bsd (Aug 1, 2016)

Phishfry said:


> User Murph has wisely pointed out the possible problems of using -CURRENT  including possibly broken security features(due to development).
> I would not use -CURRENT on any directly connected internet machine.
> I get brave behind pfSense. Good to have layered security.
> I do agree with your sediment wholeheartedly. Somebody has to test though. Who better than someone with a broken config.


What, even behind PF firewall with all incoming connections blocked?


----------



## Phishfry (Aug 1, 2016)

What if `pf` is broke while in development?
Probably not the case but something to keep in mind.
Maybe I am way off base here but it is just a 'testing version'. It could happen.


----------



## free-and-bsd (Aug 5, 2016)

Phishfry said:


> What if `pf` is broke while in development?
> Probably not the case but something to keep in mind.
> Maybe I am way off base here but it is just a 'testing version'. It could happen.


Yea, thanks for the timely alert  So I'm upgrading to beta3 -- must be better, right?


----------



## Phishfry (Aug 5, 2016)

I hate to lecture people for sure. I feel like later on in the life of FreeBSD 11 (when it was -CURRENT) things were settled and things were probably fine.

I could see the newest -CURRENT ala FreeBSD 12 being more risky due to the early stages of development.
I have seen this nowhere in writing and I make up stuff as I go!

Beta4 is due out today I see.
Geez that FTP server is like a maze trying to find stuff.


----------



## free-and-bsd (Aug 5, 2016)

Phishfry said:


> I hate to lecture people for sure. I feel like later on in the life of FreeBSD 11 (when it was -CURRENT) things were settled and things were probably fine...


It's all right, you're not telling me anything I wasn't able to figure out myself . But discussing things with others is always much better than making one's decision WITHOUT asking anyone.


----------



## sidetone (Aug 6, 2016)

Phishfry said:


> I could see the newest -CURRENT ala FreeBSD 12 being more risky due to the early stages of development.
> 
> I have seen this nowhere in writing and I make up stuff as I go!



As long as your computer doesn't blow up, or fall apart. /kidding


----------



## tmpdmp (Aug 6, 2016)

Question:

The tutorial talks about using net/samba36 for networking.  However, on freshports it says...



 DEPRECATED: not supported by the upstream


 This port expired on: 2016-04-01

It is still ok to use?  Whats the next best thing? And how to install/configure that?


----------



## tmpdmp (Aug 6, 2016)

Question 2:

Currently, Firefox version 48 is out.  If I install www/firefox now, I think version 47.0.1 is installed.  Is version 48 already ready for FreeBSD but the ports/repository isn't updated yet?  Can I just do pkg install firefox and when later versions come out do `# pkg upgrade`?  Also If I install www/firefox, does it install the 32 or 64 bit version?


----------



## shepper (Aug 6, 2016)

I run a modified desktop based on this thread and samba is not necessary unless you need to share printer/data storage with a Windows based computer.  If that is the case, I  would look at how you want to access those services.  For example, if I was using print/cups to access a printer connected to a MS computer, I would use the samba version that is a dependency of print/cups.  You can use FreshPorts to review samba versions and the dependencies.

Your second question just popped up.

`# pkg upgrade`should get you the latest version in the repository

There were 32bit pluggins (Skype) that required linux emulation and 32bit libraries.  There is also an extended support release www/firefox-esr.

Normally, if you are running a 64bit system you will get firefox/firefox-esr built for a 64bit system.


----------



## sidetone (Aug 6, 2016)

tmpdmp said:


> The tutorial talks about using net/samba36 for networking. However, on freshports it says...
> 
> 
> 
> ...



There are newer samba versions in Freshports that aren't depreciated.

I use ports-mgmt/psearch from the command line to find related programs.



tmpdmp said:


> Can I just do pkg install firefox and when later versions come out do  # pkg upgrade?



You can. Use can also use ports-mgmt/portmaster or a similar program to upgrade to a newer version, much sooner, or adjust some dependencies.


----------



## tmpdmp (Aug 6, 2016)

sidetone said:


> There are newer samba versions in Freshports that aren't depreciated.
> 
> I use ports-mgmt/psearch from the command line to find related programs.



Well, I'm not on FreeBSD ...yet.  Still getting some info down before I reinstall again and set up everything.  I checked Samba's website and it seems the latest release is *Samba 4.5.0rc1*.  I think the last stable release is *Samba 4.4.5*.  And searching Freshports yields net/samba44.  I take it the same commands and procedures to setup samba36 will work with this version (like in original tutorial)?  Also (maybe stupid question you don't have to answer) why is there a net/samba with FORBIDDEN tagged on to it?  The comments show "FORBIDDEN due to remote root code execution" but why did they not just "maintain" that port by releasing the current/fixed/patched/updated version under it?

Thanks.


----------



## tmpdmp (Aug 6, 2016)

shepper said:


> I run a modified desktop based on this thread and samba is not necessary unless you need to share printer/data storage with a Windows based computer.  If that is the case, I  would look at how you want to access those services.  For example, if I was using print/cups to access a printer connected to a MS computer, I would use the samba version that is a dependency of print/cups.  You can use FreshPorts to review samba versions and the dependencies.



Interestingly enough, I think you solved my printer issue a year ago in this Thread 50853.  I have yet to test it all out.  If it works out, I may not need Samba. 

However, I do have USB 3.0 External NTFS Hard Drives right now that I'm using.  I also have a Netgear GS108 8 Port Switch.  Would you say it is easier/simpler/faster to install sysutils/fusefs-ntfs/ and mount it directly to my FreeBSD system via USB 3.0 ports or install Samba and share the data over the network switch?  Or both ways are fine, just flip a coin and go with that?


----------



## sidetone (Aug 6, 2016)

tmpdmp said:


> "FORBIDDEN due to remote root code execution"



That's a vulnerability where a remote computer can get root access. There are 3 newer versions, and maybe the port maintainers thought it was too much overhead, or there aren't enough maintainers. That one port doesn't have a dedicated port maintainer, except for the ports tree, so that's why. It won't happen unless someone adopts the port, if they think the newer versions aren't what they need.


----------



## tmpdmp (Aug 6, 2016)

Question 3 (multipart question):

I have a Nvidia GTX960.  According to https://wiki.freebsd.org/Graphics, the card "works" and is supported.

My current way of making it work is:

`# portmaster x11/nvidia-driver`

adding 
	
	



```
nvidia_load="YES"
```
 to /boot/loader.conf

then adding:

```
Section "Device"
Indentifier "Card0"
Driver "nvidia"
EndSection
```

to /etc/X11/xorg.conf

This works for me but I have a concern about it when I installed the nvidia-driver port.

Does this port pull the latest drivers version?  I glanced at the screen output while the port was installing and if I recall correctly, the tarball it was downloading was version 346.xx or 348.xx.  Is this right?  According to Nvidia, the latest FreeBSD version (for x64) is 367.35. Am I doing something wrong?  Can I specify latest version?  Freshports shows version 346.96 for nvidia-driver and then 367.35 for x11/nvidia-xconfig.  I'm not even sure if I have the right drivers or if I am damaging my card.  Can some explain what is going on and how to resolve this by installing the correct drivers for a GTX960?

Thanks.


----------



## tmpdmp (Aug 7, 2016)

Question 4:

Firefox can preview PDF files and so far it's more than enough.

Is there any reason or benefit to install graphics/xpdf or graphics/mupdf for PDF needs?  Do they allow you to write your own PDFs?  In which case, can't you do that in LibreOffice and export to PDF?


----------



## shepper (Aug 7, 2016)

tmpdmp said:


> Question 4:
> 
> Firefox can preview PDF files and so far it's more than enough.
> 
> Is there any reason or benefit to install graphics/xpdf or graphics/mupdf for PDF needs?  Do they allow you to write your own PDFs?  In which case, can't you do that in LibreOffice and export to PDF?



It depends on your needs. graphics/xpdf is lighter and faster than the firefox pdf reader.  When I'm doing my taxes, I open the form instruction pdf in xpdf.  graphics/evince allows me to make entries in the actual form and save the completed form for my records.  I can also print the completed form to mail to the IRS.

Libreoffice allows you to export your libreoffice documents/spreadsheets to a pdf.


----------



## tmpdmp (Aug 8, 2016)

Question 5:

x11/tint according to the tutorial needs to be configured with the following commands:

`$ mkdir ~/.config/tint2`
`$ cp /usr/local/share/examples/tint2/tint2rc ~/.config/tint2/tint2rc`

However doing the cp command says no such file or directory found.

According to tint2 website it says that:


```
The first time you run tint2, it will create the config file in $HOME/.config/tint2/tint2rc (This applies if you have done a clean install. Running tint2 in the source directory without doing 'make install' will not create the config file.)
```

Are those steps in the tutorial now obsolete?

--------------------------------------------------------------

Question 6:

According to http://openbox.org/wiki/Help:Autostart

It says all you need to do is: 

```
To run commands for your user account only, create and edit a file called ~/.config/openbox/autostart
```
or

```
To run commands for all users system-wide, place them in a similar file in /etc/xdg/openbox/autostart
```

The old tutorial specifies:

`$ mkdir ~/.config`
`$ mkdir ~/.config/openbox`
`$ cp /usr/local/etc/xdg/openbox/menu.xml ~/.config/openbox/menu.xml`
`$ cp /usr/local/etc/xdg/openbox/rc.xml ~/.config/openbox/rc.xml`
`$ touch ~/.config/openbox/autostart.sh && chmod +x ~/.config/openbox/autostart.sh`
`$ echo "#!/bin/sh" >> ~/.config/openbox/autostart.sh`

Can you just get away with doing this:
`$ mkdir ~/.config`
`$ mkdir ~/.config/openbox`
`$ cp /usr/local/etc/xdg/openbox/menu.xml ~/.config/openbox/menu.xml`
`$ cp /usr/local/etc/xdg/openbox/rc.xml ~/.config/openbox/rc.xml`
`$ touch ~/.config/openbox/autostart`

Skipping the "#!/bin/sh" and making it executable script?  Then edit it to load wbar and tint2 like normal and have openbox be able to read the file and run it?  Or is there a reason it is autostart.sh and needs the chmod +x and the "#!/bin/sh"?


----------



## shepper (Aug 8, 2016)

Question 5:  There is a booboo in the FreeBSD port that likely arose when the example tint2rc's were moved to the FreeBSD example directory - the generic one is missing.  There are a number of tint2rc variants in example directory.  I updated the OpenBSD tint2 port and I remember having moved *.tint2rc and tint2rc with separate entries in the Makefile.

Your options to fix:  1)  Go to the developers' site and fetch the missing file and install into the examples directory and your ~/.config/tint2/.  2)  Run the tint2 configuration gui `$ tint2conf`, it should write the configuration file in your home directory.  3)  Copy one of the *.tint2rc files from the examples directory renaming it ~/.config/tint2/tint2rc.

Question 6:  ~/.config/openbox/autostart.sh has been renamed ~/.config/openbox/autostart

My ~/.config/openbox/autostart in OpenBSD 5.9


```
PooBear$ pwd
/home/jsh/.config/openbox
PooBear$ ls
autostart    environment  menu.xml     rc.xml
PooBear$ cat autostart                                                      
# These things are run when an Openbox X Session is started.
# You may place a similar script in $HOME/.config/openbox/autostart
# to run user-specific things.
#

# If you want to use GNOME config tools...
#
#if test -x /usr/local/libexec/gnome-settings-daemon >/dev/null; then
#  /usr/local/libexec/gnome-settings-daemon &
#elif which gnome-settings-daemon >/dev/null; then
#  gnome-settings-daemon &
#fi

# If you want to use XFCE config tools...
#
# Set Background color
# xsetroot -solid "#172636"
# Start xcompmgr
(xcompmgr -n) &
# Load feh Wallpaper
(sleep 0.5 && ~/.fehbg) &
# Start Tint2
(sleep 1 && tint2) &
# Start Wbar
(sleep 1.5 && wbar --config ~/.config/wbar/wbarrc) &
# Start weather system tray applet
(sleep 2 && yad --notification --image=weather-overcast \
--text="City, State Weather" --no-middle \
--command='xterm +sb -g 78x16-0+38 \
-T "City, State Weather" \
-e "/home/jsh/scripts/weather.sh"') &
# Start volume system tray applet
(sleep 2.5 && /usr/local/libexec/tray-app/sound) &
```


----------



## free-and-bsd (Aug 8, 2016)

tmpdmp said:


> Question 3 (multipart question):
> 
> I have a Nvidia GTX960.  According to https://wiki.freebsd.org/Graphics, the card "works" and is supported.
> 
> ...


You normally don't need any xorg.conf. Instead, you'll find in /usr/local/etc/X11 a directory named xorg.conf.d where you put some specific pieces of configuration you can't avoid putting there.

Yes, x11/nvidia-driver _will_ install the latest version of driver available for FreeBSD. But you'll want to make sure which driver version supports _your_ card. Since you know your card and given how well you know to ask precise questions  you'll find it no problem identifying the right driver version at nvidia.com. Then you will decide whether you need the nvidia-driver or one of the nvidia-driver-[older versions] driver.


tmpdmp said:


> Question 4:
> 
> Firefox can preview PDF files and so far it's more than enough.
> 
> Is there any reason or benefit to install graphics/xpdf or graphics/mupdf for PDF needs?  Do they allow you to write your own PDFs?  In which case, can't you do that in LibreOffice and export to PDF?


Neither of the two, Firefox plugin is better than both... if it doesn't bother your CPU to launch heavy firefox every time you want to view a PDF.


----------



## tmpdmp (Aug 8, 2016)

free-and-bsd said:


> Yes, x11/nvidia-driver _will_ install the latest version of driver available for FreeBSD. But you'll want to make sure which driver version supports _your_ card. Since you know your card and given how well you know to ask precise questions  you'll find it no problem identifying the right driver version at nvidia.com. Then you will decide whether you need the nvidia-driver or one of the nvidia-driver-[older versions] driver.



Well...it installs 346.96 which does support my GTX960 but Nvidia's website shows the latest is really 367.35.  In this Thread 57194, someone said the port caretaker had a reason for keeping it at 346.96.

I sometimes use my 8800GT with x11/nvidia-driver-340.



free-and-bsd said:


> Neither of the two, Firefox plugin is better than both... if it doesn't bother your CPU to launch heavy firefox every time you want to view a PDF.



To be honest, coming from Win7 x64, Firefox starts instantly on my Phenom 955 in FreeBSD compared to my Firefox on Win7. I'm not folding@home or crunching research data or doing benchmarks so Firefox can eat all the CPU it wants.


----------



## aimeec1995 (Aug 25, 2017)

To those experiencing your desktop freezing up under high cpu usage ...
sysctl kern.sched.preempt_thresh=224


----------



## Yandri Loor (Dec 11, 2017)

[CITA = "Taz, mensaje: 194.442, miembro de: 12413"] *el inicio de aplicaciones*

Ya tenemos la posibilidad de lanzar aplicaciones a través del menú [Archivo] de Openbox [/ archivo] pero me gusta usar una barra de inicio rápido para esta tarea. [Puerto] x11 / wbar [/ puerto] es una barra de inicio rápido luz y se ve muy resbaladiza. Depende de [Archivo] GTK [/ archivo] sin embargo, así que puede que quiera saltarse esta parte y configurar [Archivo] ~ / .config / Openbox / menu.xml [/ archivo] presentar para el lanzamiento rápido. También [archivo] PyPanel [/ archivo] ha construido en un lanzador appliation.

Instalar el puerto (y asegúrese de que la opción de deshabilitar WBARCONFIG):

`# portmaster x11/wbar`

Configuración:

Iniciar [Archivo] wbar [/ archivo] en el arranque [Archivo] del openbox [/ file]:

[CMD = "$"] echo "(sueño 2 && wbar) y" >> ~ / .config / Openbox / autostart.sh [/ CMD]

Esto abrirá [Archivo] wbar [/ archivo] cuando [Archivo] [/ openbox archivo] inicia y la primera vez [archivo] wbar [/ archivo] se puso en marcha se va a crear un archivo de configuración por defecto [Archivo] ~ / .wbar [ /archivo]. Más adelante se puede editar el archivo para que se adapte a sus necesidades. La configuración es bastante sencillo. Sólo tienes que especificar la ruta al icono, comandos y el texto que se mostrará.

Ejemplo:
[código]
i: /usr/local/share/pixmaps/wbar/terminal.png
c: urxvtc
t: urxvtc

i: /usr/local/share/pixmaps/wbar/music.png
c: urxvt -e mplayer -playlist ~ / tera1 / Música / RadioStream / soulful.pls
t: soulful
[/código]

Un truco agradable con el lanzamiento de aplicaciones basadas en terminales son los terminales "-e" opción. Con él se puede lanzar una ventana de terminal y hacer que se ejecute de inmediato una orden especificada detrás del interruptor "-e". De esa manera usted no tiene que poner en marcha por primera vez el terminal y luego escriba en el comando.

*Configuración de papel tapiz y la visualización de imágenes*

Para la visualización de imágenes que he elegido [puerto] / gráficos FEH [/ puerto] y podemos usarla para definir el fondo a, que está ordenada.

Instalar el puerto:

`# portmaster graphics/feh`

Configuración:

[CMD = "$"] echo "FEH --bg escala ~ / ruta / a / wallpaper.jpg y" >> ~ / .config / Openbox / autostart.sh [/ CMD]

Esto establecerá el fondo de pantalla cada vez que se inicia [Archivo] del openbox [/ archivo]. Es probable que no tiene ninguna de las imágenes todavía en su sistema para que pueda FETCH (1)  este bonito fondo de pantalla FreeBSD y configurarlo.

[CMD = "$"] cd ~ / .config / Openbox / [/ CMD]
[CMD = "$"] Explorar http://www.bsdnexus.com/wallpapers/DD_freebsd.jpg [/ CMD]
[CMD = "$"] echo "FEH --bg escala DD_freebsd.jpg y" >> autostart.sh [/ CMD]

Y si quieres ver las imágenes basta con ejecutar [Archivo] FEH [/ archivo] formar la línea de comandos y asegúrese de que está colocado en la carpeta que desea ver las imágenes:

[CMD = "$"] FEH -t [/ cmd]

Lectura adicional se puede encontrar aquí .

*Terminal emulator*

La elección del emulador de terminal correcta es muy importante ya que va a pasar mucho tiempo de usarla. Por lo que desea elegir el que se sienta cómodo. Voy a enumerar los que he probado, razones por las que me pasa a otro y explicar cómo configurar el que yo conformé con.

Estos son los que he intentado:

[Puerto] x11 / STERM [/ puerto] -> solo binario, simple y mínima, no hay pestañas.
[Puerto] x11 / xterm [/ puerto] -> utilizado durante mucho tiempo, pero no tiene soporte para pestañas
[Puerto] x11 / roxterm [/ puerto] -> depende de la [archivo] GTK [/ archivo]
[Puerto] x11 / aterm [/ puerto]
[Puerto] x11 / eterm [/ puerto]
[Puerto] x11 / rxvt Unicode [/ puerto] -> el que yo uso

[Puerto] x11 / rxvt Unicode [/ puerto] es realmente ordenado. Es compatible con las pestañas a través de [Archivo] Perl [/ archivo] extensión, tiendas de texto en Unicode, tiene la transparencia si desea que el aspecto pulido, configurable a través de [Archivo] ~ / .Xdefaults [/ archivo] archivo, ligero, rápido, demonio / cliente mod y lo más importante que simplemente funciona.

Así que si quieres probar [puerto] x11 / rxvt Unicode [/ puerto] aquí es cómo lo creó.

Instalar el puerto (opciones por defecto están bien):

[Cmd = "#"] Portmaster x11 / rxvt Unicode [/ CMD]

Configuración:

La configuración se realiza a través de [Archivo] ~ / [/ archivo] Xdefaults. Aquí es una lectura agradable sobre cómo configurarlo.

Personalmente, me gusta los solarizadas colores así que he adaptado esta [Archivo] ~ / .Xdefaults [/ Archivo] y modificado y a mis necesidades.

Le sugerimos que ejecute urxvt en modo daemon / cliente para un rendimiento más rápido y una menor huella de memoy así que corre [Archivo] urxvtd [/ archivo] en el inicio:

`$ echo "urxvtd -q -f -o" >> ~/.config/openbox/autostart.sh`

y luego usar:

[CMD = $] urxvtc [/ cmd].

Puede copiar / pegar a través del botón central del ratón. Basta con seleccionar el texto en el terminal o en otra aplicación y se "copia". Para pegarlo, ya sea al terminal u otra aplicación, pulse el botón central o ambos botones izquierdo y derecho del ratón al mismo tiempo, si usted no tiene un botón central.

Una mejor solución es un plugin Perl podemos encontrar aquí . Necesitará [puerto] x11 / xclip [/ puerto] para que funcione y el camino para los plugins urxvt Perl en FreeBSD es [Archivo] / / local / lib usr / urxvt / Perl / [/ archivo]. Cómo configurarlo se describe en el enlace proporcionado.

Si no desea utilizar pestañas para tener múltiples terminales en una sola ventana, echar un vistazo a [puerto] sysutils / tmux [/ puerto], que es un multiplexor terminal.

*montaje de automóviles*

Como se mencionó antes no utilizaremos [Archivo] hal [/ archivo], pero de FreeBSD DEVD (8) wich colocarse para el "cambio de estado del dispositivo demonio".

Hay una secuencia de comandos que Wrapps alrededor DEVD (8) y dosificar el montaje para nosotros: [puerto] / sysutils montan automáticamente [/ puerto].

Instalar el puerto:

[Cmd = "#"] sysutils Portmaster / automount [/ CMD]

La configuración se realiza a través de [Archivo] /usr/local/etc/automount.conf [/ archivo] y se puede ejecutar este comando para ver qué opciones tiene:

[CMD = "$"] automontar --help [/ cmd]

Sólo tiene que utilizar esta opción en mi [Archivo] /usr/local/etc/automount.conf archivo [/ file]:
[código]
REMOVEDIRS = "YES"
[/código]

Si desea montar unidades NTFS formateados con las operaciones de lectura / escritura que tendrá que instalar [puerto] / sysutils fusefs NTFS [/ puerto].

Instalar el puerto:

[CMD = "#"] sysutils Portmaster / fusefs NTFS [/ CMD]

Configuración:

[CMD = "#"] cp /usr/local/modules/fuse.ko / boot / módulos / [/ CMD]
[CMD = "#"] echo "fuse_load = \" SI \ "" >> /boot/loader.conf[/CMD]

Esto cargará el módulo del kernel en el arranque y [Archivo] automontar [/ archivo] reconocerán que se ha instalado [Archivo] fusefs NTFS [/ Archivo] y va a usar para las unidades con formato NTFS.

Si desea montar un automóvil disco duro IDE / SATA conectado a la placa madre comprobar este hilo hacia afuera.

En caso de que usted se está preguntando cómo usarlo con la mano aquí es el comando que puede emitir para montar unidades NTFS:

[CMD = "#"] ntfs-3g / dev / da * s1 / mnt [/ CMD]

Ejecutar este comando para averiguar qué número Repalce "*" por:

[CMD = "#"] dmesg [/ cmd]

*X a partir*

Ahora debemos estar listos para comenzar nuestra primera sesión de Xorg. Pero primero vamos a reiniciar el sistema:

[Cmd = "#"] shutdown -r now [/ cmd]

Si desea apagar el uso de este comando:

[Cmd = "#"] apagado -p ahora [/ cmd]

Y si quieres ser capaz de reiniciar o apagar desde el openbox sin ser root debe agregar su nombre de usuario al grupo de operadores:

[Cmd = "#"] pw groupmod -m operador nombre_usuario [/ cmd]

Antes de pasar concretamente a Xorg asegúrese de que puede ejecutar el emulador de terminal, ya sea desde el menú [Archivo] wbar [/ archivo] o de [archivo] de Openbox [/ archivo]! Ahora usted debe ser capaz de saber cómo hacerlo.

Una vez que haya iniciado sesión con su nombre de usuario ejecutar este comando para iniciar [Archivo] Xorg [/ file]:

[Cmd = "$"] startx [/ cmd]

Si todo ha ido bien y se ha optado por utilizar [Archivo] del openbox [/ archivo] con [archivo] tinte [/ archivo] y [Archivo] wbar [/ archivo] se debe ver algo como esto:





Si usted no está viendo algo como esto significa que algo salió mal y usted tendrá que solucionar los problemas que tiene. Mi sugerencia es que la primera búsqueda Google en busca de respuestas y si eso no funciona, entonces la dosis puesto aquí en busca de ayuda. [/ Quote]

Hola, soy nuevo en FreeBSD, y, al igual que le pasó a usted, yo también me canso de tantos programas que no utilizo, tengo un problema, la imagen de Xorg es extremadamente pequeño, y no tengo ni idea de cómo usarlo, yo ya leí la página del openbox y no encontrar ninguna solución, creo que mi problema viene de mi tarjeta nvidia.


----------



## vermaden (Dec 12, 2017)

@ Yandri Loor

I mean no harm but this cite from _Pulp Fiction_ seems to the best comment


----------



## Zamana (Sep 15, 2020)

Hi!

This tutorial is from 2012... Does anybody knows if is it still applicable nowadays, with little tweak regarding the package versions?

Thanks.


----------



## unitrunker (Sep 15, 2020)

I've had great success with desktop-installer.






						FreshPorts -- sysutils/desktop-installer: Quickly configure a FreeBSD desktop system
					

Desktop-installer is a post-install script to assist in setting up a FreeBSD desktop system using any of the mainstream desktop systems.  It automatically installs essential software and configures subsystems such as dbus, CUPS, etc. for typical use.




					www.freshports.org


----------



## tmpdmp (Feb 22, 2021)

Attached is basic instructions that I put together based on this thread.  Let me know if there is some better instructions than what I have already (for example, better firewall rules).


----------



## First_Law_of_Unix (May 22, 2022)

How can I just simply launch x-terminal with a line of code? I want to use x-terminal app because it has support for 16 bit true color. I don't need any mouse, windows or taskbar.

Thanks.


----------



## jmos (May 22, 2022)

I have no clue what your "x-terminal app" is - there's no package/port with that name available. But I assume that it is something like a xterm.

Just use your terminal application as a window manager. Whether you used ~/.xinitrc or ~/.xsession to start a desktop environment or window manager, just start from there f.e. your xterm instead (you might want to add some parameters like "-geometry 150x50").


----------



## Deleted member 30996 (May 29, 2022)

First_Law_of_Unix said:


> How can I just simply launch x-terminal with a line of code? I want to use x-terminal app because it has support for 16 bit true color. I don't need any mouse, windows or taskbar.
> 
> Thanks.


From the command line:

```
xterm[code]

From .xinitrc:
[code]xterm &
```

Run a command in xterm From the Fluxbox menu:

```
[exec]   (top) {xterm -e top}
```

I've got FreeBSD 13.1 installed on one machine and will be updating my tutorial,  but lost m phone that has pix of every screen during the install process.. 

About the only change that needs to be made is the addition of choosing ASLR in the Sytem Hardening screen and change the need for Linux compat during Nvidia setup.  

I have site work to do in addition to editing the tutorial and will do that first.


----------



## grahamperrin@ (May 29, 2022)

First_Law_of_Unix said:


> … simply launch x-terminal with a line of code? …



You might take the _working_ example at <https://unix.stackexchange.com/q/504188/13260> and adapt it to: 

*not* use bash (because bash is not integral to FreeBSD), use `!/bin/sh`
use, or not use `/usr/local/bin/twm` (the path on FreeBSD)
`exec /usr/local/bin/xterm`


----------

