# From core system to desktop - to terminal and file server



## Psypro (Jan 17, 2015)

Update 19.01
Today I managed to boot from iso disk onto xfce in under 1 hours. New record for me.
If setting locals where no problem, it would work out of the box.
This time i used pkg install.
It was alott faster then portsnap.

I have yet to manage to set correct locals or samba server. But today I made primary computher dual boot with freebsd on one hdd and windows 8 on another hdd. I use bios to change which system to boot.


16.01
Old hard disk fails. Had xorg with xfce4 working. Even managed xrdp and remote desktop connection. How hard can it be to reinstall FreeBSD with xfce on a new hard disk?
Intel E8400, 4 GB ram. New 2 TB hard disk.

**********************************

Possible faults in FreeBSD handbook

Nr1:

6.8 Desktop environments

`pkg install gnome2`

Does not work. Changing to gnome3 makes it work.


*****************************************



16.01.
Boot from ISO. Base installation.

17.01

```
portnsap fetch extract
cd /usr/ports/x11/xorg
make clean install
portsnap fetch update
cd /usr/ports/x11-wm/xfce4
make clean install
startx
```
BLACK Screen.

Reading handbook https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-config-quick-start.html

`nano /etc/rc.conf`

```
enable_hald="YES"
enable_dbus="YES"
```

Ctrl-alt-del.
`startx`
Black screen.
Ctrl-alt-del.

`nano /root/xorg.conf.new`
Check that screen uses the PCI card1. Done.
Rename /root/xorg.conf.new -> /root/xorg.conf
`startx`
Black screen.
Ctrl-alt-del.

Does hald and dbus really work I wonder.
`service hald start`
Service hald must be enabled in rc.d ................... !!!!

FreeBSD handbook says rc.conf.

Did I do something wrong in configuration in the make process? Must on activity click to get hald and dbus?


```
cd /usr/ports/x11/xorg
pkg remove xorg-server
make clean
make clean-dependencies
make install clean
```
Doesn't get all the configurations. It is computing again but don't interrupt for questions.

/usr/ports/sysutilities
I see hal, but no hald.

Hal = hald. But something seems wrong, can't start the service.
Trying to install Gnome with `pkg`, might that give me hal since it from Gnome.

`pkg install gnome2`
Fail to find gnome2
(Handbook seems wrong)

Let's be creative, changing 2 to 3.

Yes, gnome3 packet start installing.

Hurrah. After installing gnome3 with `pkg`. I now have hald and dbus.
Now `service hald start`, start the hald service : )

Some hours later.

With non root user: `startx` works : )

`cd /usr/ports/x11-wm/xfce4`
`make clean install`

Normal user now has access to xfce : )
Maybe something got cleaned out earlier when removing dependency. It helps to rebuild xfce.


Current goal be able to leave xfce4, troublesome to restart every time one wants to go to tty1.

Update

By adding

```
kern.vty=vt
```
to /boot/loader.conf.

I can now switch between xfce and tty 

Current goal :

Reaserch if xorg.conf is needed. Only uses .xinitrc right now.

X -configure that makes the xorg.conf.new is broken in freeebsed 10 from reading on forum. I am no expert, but it id not work for me either.

Moving on to samba server.
Trying to folow the guide, http://christopherve7alb.blogspot.no/2013/11/installing-samba-4-on-freebsd.html
It seems well written, at it does not pretend that it will work "Make install clean" (like the freebsd handbook does. This guide tell what error that will come, and what to do)

Arg, this is pain. I am very frustrated. I have not writen close to all the tings I have read, and tryed. I am almost considering giving up. But on the bright side, progress have benn made to day. (xfce4 working, and switching between xfce and tty)

Some progress also with samba. Samba4 is installed.
But so fare I dont know how to share a folder, or to know if is it is running.

***********
Slow progress with samba. Much information on the net about samba 3.X. Less about 4.x. Any body have a linke to a simple guide for setting up samba. Until I find some good ideas for how to do it, I am going to try setting up good old ftp.
Might that to the same? I want to have the freebsd as a fileserver for windows pc.


**************

A real easy way to filshare : )

Freebsd comes with built in ftpd server.

/etc/rc.conf

```
ftpd_enable="yes"
```

Not many clicks. Excellent guide in the freebsd handbook on ftp server subject.

In windows 8, map ftp network share. I can now drag and drop files between my windows and freebsd server (I want to set up a desktop system to get to learn the freebsd system, and have terminal server functionality)

Also this is my first post where i might have used the file, code formation correct. I have had some friendly but determined contact from site admin. I hope I learn to use the correct layout her as well.

As happy as I am with ftp access, any new user friendly step, buy step guide to get samba4 sharing a folder for windows pc?

**************************

I got xrdp working again, i have terminal l server : )
Excellent guide at : http://w.vmeta.jp/tdiary/20131015.html

I installed
xrdp and x11rdp

For hours it would not work. I would only get a connection to the xrdp but, not get throug to xfce. I enabled tighervnc also. Dont know if that helped. Installed xvnc.


```
cd /usr/ports/net/xrdp
```


```
make rmconfig
           make clean install
           make reinstall
```
/var/log/xrdp-sesman.log

```
[20150118-07:26:29] [WARN ] [init:45] libscp initialized
[20150118-07:26:29] [CORE ] starting sesman with pid 577
[20150118-07:26:29] [INFO ] listening...
[20150118-07:26:31] [WARN ] receiving SIGHUP 1
[20150118-07:26:31] [CORE ] shutting down log subsystem...
[20150118-07:26:31] [INFO ] configuration reloaded, log subsystem restarted

#That was before conection
[20150118-07:28:00] [INFO ] scp thread on sck 7 started successfully
[20150118-07:28:00] [INFO ] ++ created session (access granted): username XXX, i$
[20150118-07:28:00] [INFO ] starting X11rdp session...
[20150118-07:28:00] [INFO ] starting xrdp-sessvc - xpid=808 - wmpid=807
[20150118-07:28:30] [INFO ] starting xrdp-sessvc - xpid=908 - wmpid=907
```

************************************
18.01.
Server is now placed in seperat room.

Todo


Nr1 : Get nb_NO.UTF-8 or similar to work in Xfce xrdp session.
Nr2: Get samba working.
Nr3: (Find another old pc and try to get it up and running, with a webserver)

In local session on the server i type 
	
	



```
setxkbmap no
```
The same command does not work in remote session.

******************************************
Yes, new progress.

xrdp with x11rdp does not accept the 
	
	



```
setxkbmap no
```
but xrdp + tigervnc/xvnc? (sesman-xnvc choise from windows side) does accept the  
	
	



```
setxkbmap no
```


----------



## gogamoga (Jan 17, 2015)

*kernel config:*

disable: vga, VESA, sc, SC_PIXEL_MODE

enable: vt, vt_vga, vt_efifb
rebuild kernel and you will be able to go X <--> tty

P.S
xorg.conf is not needed


----------



## Psypro (Jan 17, 2015)

Thank you for the reply.


----------



## Beastie (Jan 17, 2015)

Building a custom kernel is not needed to enable the new KMS-enabled VT. Adding *kern.vty=vt* to /boot/loader.conf is perfectly enough.



Psypro said:


> Does hald and dbus really work I wonder.
> `service hald start`
> Service hald must be enabled in rc.d ................... !!!!
> 
> FreeBSD handbook says rc.conf.


rc.d are startup scripts. You can start services in the current system right away with *onestart* instead of *start*. This bypasses whatever is included in /etc/rc.conf.
You should add the *enable_hald* and *enable_dbus* settings to /etc/rc.conf like the documentation says to make it persistent across system reboots.



Psypro said:


> I am almost considering giving up. But on the bright side, progress have benn made to day.


At this point, it would be a shame really!

Some minor settings you may want to consider adding to /boot/loader.conf:

```
autoboot_delay="3"
kern.cam.ada.legacy_aliases=0
```

For a desktop you probably should also enable user mounting of devices by following these steps.

A xorg.conf file is not needed on the majority of systems. If you need to, you can reset some settings through external commands. Example of running DPMS-related commands in ~/.xinitrc:

```
...
xset -dpms
xset s off
...
exec some_window_manager
```


----------



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

Beastie said:


> ...
> You should add the *enable_hald* and *enable_dbus* settings to /etc/rc.conf like the documentation says to make it persistent across system reboots.
> ...


 Are you people sure he really needs the hald stuff? Because the current x11-servers/xorg-server port has devd enabled by default, and not hald. And I assume the precompiled packages will have been compiled with the defaults, no? If so, he will need devd_enable="YES" in /etc/rc.conf for it to work. In which case hald_enable, if present, must be set to "NO". Please correct me if I'm wrong.

With this said, even GNOME can be compiled without hald, let alone XFCE. Though I can't be sure they _were_ so compiled as packages... From my own experience there is no need whatsoever for hald in FreeBSD ports, so chances are the packages were built without it? At least that must be checked.


----------



## Psypro (Jan 18, 2015)

This is an interesting question.


----------



## wblock@ (Jan 18, 2015)

It probably does not matter until X shows a working screen with a mouse pointer.  HAL was used by the X server to locate input devices.  The default changed a couple of weeks ago, but many people still run it.  As far as I know, Gnome and KDE still need HAL for some things, but again, until X is working, it does not matter.

devd(8) is enabled by default, and I'm fairly sure X does not even need it.


----------

