# FreeBSD fails to install X11 (or xorg)



## Tezzsun (Oct 14, 2012)

Okay, so I'm running FreeBSD on Virtualbox. Since I'm a windows noob, using the command line to navigate around my FreeBSD operating system is pretty hard and annoying.

I'm trying to install a GUI since its easier for me to navigate around (and since I'm so used to Microsoft Windows)

Now, I'm following the FreeBSD handbook guide here on installing FreeBSD:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-install.html

Now, I remember reading from another forum that if you try to install Xorg from "Ports Collection" or by using the first command:

```
# cd /usr/ports/x11/xorg
# make install clean
```

It may crash my FreeBSD server since its too big (the user from another forum said it burned his laptop chip since its too big)

Having no desire to take big risks like that, he told me the second method which is:

```
# pkg_add -r xorg
```

Knowing this will fetch and install (instead of compiling and install), I did that command. This is what always happens to me (yea, I tried this many times on different VB's)
http://i.imgur.com/8arcA.png
http://i.imgur.com/iFgA1.png
http://i.imgur.com/Gu9CW.png
http://i.imgur.com/MQmTZ.png
http://i.imgur.com/AwzRk.png
http://i.imgur.com/I1FB4.png

So its like a never-ending errors. I have no idea why. I don't have much installed on it already (other than PHP + Apache + phpMyAdmin + MySQL) and its connected to the internet for sure.

Any reason why its failing?


----------



## wblock@ (Oct 15, 2012)

Tezzsun said:
			
		

> Okay, so I'm running FreeBSD on Virtualbox. Since I'm a windows noob, using the command line to navigate around my FreeBSD operating system is pretty hard and annoying.
> 
> I'm trying to install a GUI since its easier for me to navigate around (and since I'm so used to Microsoft Windows)
> 
> ...



That may be just a misunderstanding.  Certainly, it's not factually accurate to say that X is "too big" to be compiled on an average machine.  Or that it's dangerous.  It would make things more interesting, though.



> Having no desire to take big risks like that, he told me the second method which is:
> 
> ```
> # pkg_add -r xorg
> ...



Giving pictures instead of actual text makes this more difficult.  It appears to me that you have a bunch of things already installed.  Then you want to install more, but the new packages want new dependencies.  This is yet another reason to use ports, and keep them up to date.  Then the dependencies get compiled.  Packages need whatever was current when they were built.  If you don't have those installed, they need to be deleted and replaced with the new version.



> So its like a never-ending errors. I have no idea why. I don't have much installed on it already (other than PHP + Apache + phpMyAdmin + MySQL) and its connected to the internet for sure.



Do a pkg_info | wc -l.  You probably have at least a couple of hundred packages, most of which were installed as dependencies.


----------



## Tezzsun (Oct 15, 2012)

wblock@ said:
			
		

> That may be just a misunderstanding.  Certainly, it's not factually accurate to say that X is "too big" to be compiled on an average machine.  Or that it's dangerous.  It would make things more interesting, though.
> 
> 
> 
> ...



The pictures I'm showing are actually trying to install Xorg a 3rd time on a machine. The problem is when I click "PrntScreen", it just goes back to login page so I'm not sure if it just stopped the installation or put it on pause.

Luckily I always clone a working one so in case one gets messed up, I don't start from scratch. I'll try installing from ports but how can I copy the text from FreeBSD and paste it into Windows?


----------



## wblock@ (Oct 15, 2012)

Use PuTTY to ssh into it, and copy from that?  Can't recall whether that works.


----------



## Tezzsun (Oct 15, 2012)

wblock@ said:
			
		

> Use PuTTY to ssh into it, and copy from that?  Can't recall whether that works.



I'm waiting for Xorg to install as its taking like over 30 minutes. I found this though:
http://www.pcbsd.org

It says it's FreeBSD but with a GUI. I was wondering whats the main difference like is it going to sacrifice security or using an old version of FreeBSD?

Thanks! I'll report what happened to xorg


----------



## wblock@ (Oct 15, 2012)

If you're concerned about security, not installing X on a server would be something to consider.  PC-BSD is good, it's FreeBSD with X and KDE preconfigured.  I would not use it for a server.


----------



## Tezzsun (Oct 15, 2012)

wblock@ said:
			
		

> If you're concerned about security, not installing X on a server would be something to consider.  PC-BSD is good, it's FreeBSD with X and KDE preconfigured.  I would not use it for a server.



Huh? surprising answer! First of all, I have not forgotten to post my results of installing Xorg, it's been over an hour and it's still downloading. 

I'm not trying to make a host but a website and security is the top priority since I'm sure people will try to attack it (It's not bad but considering that in today's society, if there is one vulnerable page on Google, 500 people will try to attack it hence the reason why I chose FreeBSD)

I'm just wondering why it would be bad. I was thinking of creating a jailed environment so if a user did break in and gain root access, he would be stuck within the jail and cannot modify my actual system. I just though a GUI would help me navigate around the system instead of learning many command codes.

I'm just wondering why you would consider it?


----------



## wblock@ (Oct 15, 2012)

It's simple: the more software installed on a server, the more opportunities for a security hole.  X is a big chunk of software, the desktop environments like KDE even more so.  Web management tools like Webmin have had numerous exploits, too.  The less of this, the better.  Jails are good, virtualization is good, but so is only having software that's really needed.  You'd really be better off learning the one or two dozen basic commands that cover most tasks.


----------



## UNIXgod (Oct 15, 2012)

Tezzsun said:
			
		

> Huh? surprising answer! First of all, i have not forgotten to post my results of installing Xorg, its been over an hour and its still downloading.
> 
> Im not trying to make a host but a website and security is the top priority since im sure people will try to attack it (Its not bad but considering that in todays society, if there is one vulnerable page on Google, 500 people will try to attack it hence the reason why I chose FreeBSD)
> 
> ...



There is really no reason to run X on a server. More software installed means more binaries that can be executed or exploited. Servers are a less is more situation.

Now for you client boxes anything goes.

It not a big deal to learn the commands. Those commands can be used to automate you server as well.

I've run irc clients inside jail on a server before. If you really want to test your firewall and security. Do that. Every bot on the planet will pick up your ip and ddos you.


----------



## Tezzsun (Oct 15, 2012)

UNIXgod said:
			
		

> There is really no reason to run X on a server. More software installed means more binaries that can be executed or exploited. Servers are a less is more situation.
> 
> Now for you client boxes anything goes.
> 
> ...



Good point there... I plan to have CloudFlare since it does help. Im only installing the essentials.

I was looking into nginx since it can handle different kinds of connection types (not just IP-based) which is really good. I do need PHP + MySQL + PHPMyAdmin and i think Apache is needed to run all these softwares anyway.

By the way, sshd is failing for some reason. I did read this guide:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/openssh.html

Now, i will admit i didn read it all but i do have "sshd_enable="YES"" on my rc.conf

I also tested to see if it was on and got this back:
"sshd already running? (PID=1061)"

My VB is not hiding behind a NAT and my PuTTY was able to connect to it but fails:






My FreeBSD username: root
My FreeBSD password: root

It should work shouldnt it? Also, while typing this, an error came up on PuTTY:





Anything im missing?


----------



## wblock@ (Oct 15, 2012)

root login via ssh is disabled by default.  It's a security thing.  Log in as your normal user, a member of the wheel group, then use su(1) to switch to root.

Resist the urge to enable root logins via ssh.  It's a trap.


----------



## Tezzsun (Oct 15, 2012)

wblock@ said:
			
		

> root login via ssh is disabled by default.  It's a security thing.  Log in as your normal user, a member of the wheel group, then use su(1) to switch to root.
> 
> Resist the urge to enable root logins via ssh.  It's a trap.



Okay, I think I got everything cleared. As for the "xorg", it said it cleaned but when I type *startx*, it fails (even after reboot) so I'm quitting that.

Also, just to clarify, there is no easier way? Putty is good but I cannot "Select All" and stuff like that.


----------



## UNIXgod (Oct 15, 2012)

Tezzsun said:
			
		

> Okay, I think I got everything cleared. As for the "xorg", it said it cleaned but when I type *startx*, it fails (even after reboot) so I'm quitting that.
> 
> Also, just to clarify, there is no easier way? Putty is good but I cannot "Select All" and stuff like that.



Please define "Select All"?


----------



## SirDice (Oct 15, 2012)

In PuTTY go to Session -> Logging and turn on Session logging. You could also increase PuTTY's scrollback buffer.


----------



## Tezzsun (Oct 15, 2012)

UNIXgod said:
			
		

> Please define "Select All"?



You know windows has the ability to select all text? I can't do that in FreeBSD...


----------



## SNK (Oct 15, 2012)

Did you update your PACKAGESITE? Otherwise you are pulling in old packages. Or are you only using ports now?


----------



## Tezzsun (Oct 15, 2012)

SNK said:
			
		

> Did you update your PACKAGESITE? Otherwise you are pulling in old packages. Or are you only using ports now?



Well I tried following this:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-install.html

I used 

```
# pkg_add -r xorg
```

Since I heard it's a lot safer method to do then downloading and recompiling it.


----------



## wblock@ (Oct 16, 2012)

In FreeBSD, click and drag to highlight text.  I don't think there is a "select all", which would be less useful because the scrollback buffer can be thousands of lines.  Start an editor, middle-click to paste.  PuTTY on Windows, don't know, haven't used it lately.


----------



## wblock@ (Oct 16, 2012)

Tezzsun said:
			
		

> Well i tried following this:
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-install.html
> 
> I used
> ...



I already described that idea as factually inaccurate.  Don't make me say what I really think of it.


----------



## Tezzsun (Oct 16, 2012)

wblock@ said:
			
		

> I already described that idea as factually inaccurate.  Don't make me say what I really think of it.



Yes, *I* was just saying it to the other guy. I think *I'*m deciding not to add a GUI anyway because you brought up some good points about being more exploits.


----------



## UNIXgod (Oct 17, 2012)

Tezzsun said:
			
		

> Yes, *I* was just saying it to the other guy. I think *I'*m deciding not to add a GUI anyway because you brought up some good points about being more exploits.



Look at 3.3:
http://www.freebsd.org/doc/en/articles/linux-users/software.html

Most people use ports and build their own binaries. Currently there are issues with mixing both ports and packages on the same system. This may be resolved with a new toolset which is aimed to replace pkg_add, and other pkg_* programs, called pkgng.


----------



## echo6 (Jan 26, 2013)

I tried to install via;


```
# cd /usr/ports/x11/xorg
# make install clean
```

And got this;


```
config.status: executing libtool commands
rm: libtoolT: No such file or directory
gmake[3]: Leaving directory `/usr/ports/textproc/libxml2/work/libxml2-2.7.8'
gmake[3]: Entering directory `/usr/ports/textproc/libxml2/work/libxml2-2.7.8'
gmake[3]: Leaving directory `/usr/ports/textproc/libxml2/work/libxml2-2.7.8'
gmake[2]: Leaving directory `/usr/ports/textproc/libxml2/work/libxml2-2.7.8/include'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/ports/textproc/libxml2/work/libxml2-2.7.8'
gmake: *** [all] Error 2
*** [do-build] Error code 1

Stop in /usr/ports/textproc/libxml2.
*** [lib-depends] Error code 1

Stop in /usr/ports/textproc/libxslt.
*** [install] Error code 1

Stop in /usr/ports/textproc/libxslt.
*** [build-depends] Error code 1

Stop in /usr/ports/x11/libxcb.
*** [build-depends] Error code 1

Stop in /usr/ports/x11/libX11.
*** [build-depends] Error code 1

Stop in /usr/ports/graphics/imlib2.
*** [install] Error code 1

Stop in /usr/ports/graphics/imlib2.
*** [lib-depends] Error code 1

Stop in /usr/ports/x11/3ddesktop.
*** [_3ddesktop.realinstall] Error code 1

Stop in /usr/ports/x11.
```

When I tried pkg_add -r xorg I got


```
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9.1-release/Latest/xorg.tbz: File unavailable (e.g., file not found, no access)
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9.1-release/Latest/xorg.tbz' by URL
```


----------



## SNK (Jan 27, 2013)

In case you switch to pkgng you might want to check out http://mirror.exonetric.net/pub/pkgng/ for quite up-to-date packages. Not all repos are online yet though.


----------

