# Things seem really slow on clean install of FreeBSD



## codeblox (Jun 3, 2012)

I've done a clean install of FreeBSD in a virtual machine. I noticed that it takes a much longer time doing some things that are pretty much instant in Ubuntu (which is where I'm coming from). For one, when booting up, the SSH Daemon (sshd) takes like 25 seconds just to finish. I installed emacs and that takes like 20 seconds to load as well... I did install gnome but had nothing but problems with it. Keyboard wouldn't work, kept freezing up, and eventually the damn VM starting going through a boot loop. Whats the deal? I mostly want to get the EMACS thing fixed.


----------



## Martillo1 (Jun 3, 2012)

How much memory and processors (and cap) did you assign to the VM?


----------



## sossego (Jun 3, 2012)

The responsiveness of the virtual machine is dependent upon a few factors:


VM type:
Is it qemu, virtualbox, vmware, or some other?
Processor:
64 or 32 bit? Virtual capabilities based upon PAE or AMD-V or Intel-VTx
Base system:
Are you running a heavy desktop or a minimalist for the host?
Other hardware:
This is for every OS>


----------



## codeblox (Jun 3, 2012)

This is using VirtualBox.I've assigned the guest 1024MB of RAM and left it with a single processor. My host is running Windows 7 64 bit with an i5 2500. Total RAM in this system is 8GB.


----------



## codeblox (Jun 3, 2012)

Execution cap is 100. Don't mean to double post but I don't see an edit button.


----------



## sossego (Jun 3, 2012)

Did you edit /boot/loader.conf?


----------



## Martillo1 (Jun 3, 2012)

1024 MB seems ok. Try to assign 2 processors.


----------



## wblock@ (Jun 3, 2012)

codeblox said:
			
		

> I've done a clean install of FreeBSD in a virtual machine. I noticed that it takes a much longer time doing some things that are pretty much instant in Ubuntu (which is where I'm coming from). For one, when booting up, the SSH Daemon (sshd) takes like 25 seconds just to finish.



If it's slow but shouldn't be, suspect DNS timeouts.  Is there a localhost entry in /etc/hosts?



> I installed emacs and that takes like 20 seconds to load as well... I did install gnome but had nothing but problems with it. Keyboard wouldn't work, kept freezing up, and eventually the damn VM starting going through a boot loop. Whats the deal? I mostly want to get the EMACS thing fixed.



Possibly DNS also, maybe with the editor trying to look up localhost or some network resource.


----------



## codeblox (Jun 3, 2012)

Currently installing xorg. I did check my hosts earlier and it was empty O_O. I'll add the local host entry once this is done. So EMACS does name lookups as well?


----------



## codeblox (Jun 3, 2012)

I edited /boot/loader.conf earlier as something in a google search suggested adding 


```
kern.hz=100
```
Didn't seem to make a difference though.


----------



## codeblox (Jun 3, 2012)

*W*ait, I take it back, my hosts file (with an 's') does have a localhost entry.


----------



## wblock@ (Jun 3, 2012)

Another thing to try is PC-BSD, which I think has the VirtualBox guest additions already in place for the live CD.


----------



## sossego (Jun 3, 2012)

codeblox said:
			
		

> I edited /boot/loader.conf earlier as something in a google search suggested adding
> 
> 
> ```
> ...



A kernel hertz rate of 1000 to 2500 is sufficient for a desktop system.
Did you install a complete system- such as with window manager and applications- or just the base system?


----------



## codeblox (Jun 3, 2012)

I only installed Xorg. But this issue was and still is happening before that. Even a *startx* takes quite a bit of time. Before I try the PC-BSD thing, I'm trying to build the vbox guest additions and install them. Jeez, building things on this OS consumes an unacceptable amount of disk space too.


----------



## sossego (Jun 3, 2012)

You would be better off in the following fields if you would find yourself some older hardware on which you can install FreeBSD:

System responsiveness
Learning
Maintenance
 Et cetera, et al

Even with multiple cores, the host system will determine the basic stress and requirements on the machine.


----------



## codeblox (Jun 3, 2012)

Not sure if you're being sarcastic or not. Are you saying FreeBSD is better off not installed in a VM? I'm willing to go this route if you're serious. My whole point in trying to get FreeBSD up and running is to learn how it works. I've been obviously spoonfed everything with all the Ubuntu use and wanted to see if I could get a working install of FreeBSD and install the desktop environment myself.


----------



## codeblox (Jun 3, 2012)

My host machine has more than enough resources to handle FreeBSD. What are some more possibilities for things going SO_SLOW?


----------



## wblock@ (Jun 4, 2012)

The rules for kern.hz changed recently, at least on i386/amd64 architectures, and setting it to 100 is now recommended... although I can't remember where.

Is it slow in a real console?  Turning off our old friend AllowEmptyInput for xorg can make X seem very slow due to input not being read correctly.


----------



## codeblox (Jun 4, 2012)

It's slow in console and with the x window system. Disappointing, I was really looking forward to learning this OS. Is this how it really is for people? Should I try reinstalling it? Note ** When I got gnome installed, my keyboard wasn't even working with it after a few keystrokes of logging in...


----------



## wblock@ (Jun 4, 2012)

codeblox said:
			
		

> It's slow in console and with the x window system. Disappointing, I was really looking forward to learning this OS. Is this how it really is for people?



Hasn't been that way for me, although I guess I haven't used Windows for a VirtualBox host much.



> Should I try reinstalling it? Note ** When I got gnome installed, my keyboard wasn't even working with it after a few keystrokes of logging in...



Possibly a HAL thing.  Again, try PC-BSD.  All of the configuration is already done.


----------



## codeblox (Jun 4, 2012)

I'll give it a whirl and see what happens. I'll probably go back to this and try again, even though I have reinstalled this twice already for different reasons with the same result. I haven't had this problem with other guest OS on this machine.


----------



## codeblox (Jun 4, 2012)

Well, things seem to work fine in PC-BSD. I downloaded the virtualbox disk image which looks like someone else already did the installation. Very nice.


----------



## codeblox (Jun 4, 2012)

I got Xfce installed in freebsd FreeBSD and I like the sleek simple look a lot. More satisfied with this than gnome. This would be perfect if my slow response issue would go away.


----------



## wblock@ (Jun 4, 2012)

A lot of us like xfce. 

Wait, you mean the slow response problem didn't go away?  When creating the VM, did you change any of the defaults in VirtualBox?


----------



## codeblox (Jun 4, 2012)

For PC-BSD, everything worked fine and emacs came right up which was great - and by the way, PC-BSD looks awesome -. I went back to FreeBSD and reinstalled again and this time installed XFCE instead of GNOME. When launching my applications like firefox or emacs there's a 20 or so second delay. Stuff that was already installed with FreeBSD comes right up without a delay - Vi for example-. I left all the defaults settings in Virtualbox for both PC-BSD and FreeBSD.


----------



## codeblox (Jun 4, 2012)

GUYS! Really weird, I added 
	
	



```
FreeBSD-01v
```
 to my /etc/hosts files loopback address and now things are starting right up and it's working really fast now. I didn't expect that to fix it but FreeBSD seems to be working fine now. So now my hosts file looks like the following: 


```
127.0.0.1		localhost FreeBSD-01v localhost.my.domain
```


----------



## codeblox (Jun 4, 2012)

BTW, "FreeBSD-01v" is my machine*'*s hostname. Just saying as to help someone else who may come across this problem.


----------



## wblock@ (Jun 4, 2012)

I should have been more specific in post #8.  It's not just localhost, but some things want the old FQDN, or at least the real IP address should resolve to the hostname.


----------



## fluca1978 (Jun 5, 2012)

wblock@ said:
			
		

> Possibly DNS also, maybe with the editor trying to look up localhost or some network resource.



I had also the same problem with emacs when running disconnected from the network, and fixed placing the machine name in /etc/hosts.


----------



## kpa (Jun 5, 2012)

You can also use an alias IP on the network interface that is otherwise configured with DHCP:


```
hostname="myhost.mydomain"
ifconfig_em0="SYNCDHCP"
ifconfig_em0_alias0="inet 192.168.1.100/24"
```

And put this in /etc/hosts (and leave the localhost line as it is)


```
192.168.1.100   myhost.mydomain    myhost
```

If your machine is a router with 2 or more interfaces then you can just use the LAN IP address as myhost.mydomain.


----------

