# New to FreeBSD, is this possible



## smee204 (Jun 20, 2011)

Hi I am new to FreeBSD and am building my first home server. I have a few questions as I am not sure if FreeBSD is suitable for me. 

I am building a server to do the following:
- store and backup my documents, photos, music, tv, etc. 
- pvr functionality (maybe mythtv or tvheadend)
- possibly replace my router and firewall
- potentially small website host in future

Is FreeBSD the best OS for this? 

I was planning to use FreeBSD mainly because of the ZFS file-system and I want the ability to add extra hard drives when ever I want. 

I currently have a linksys router running dd-wrt and wondered would it be better to get rid of this and use the server as a firewall and dhcp server etc? Would this be beneficial or am I best sticking with the router?

I was thinking the best option might be to run FreeBSD as my host OS for the ZFS and firewall functionality and run MythBuntu in a virtual machine for the pvr functionality. Is this the best way?

My hardware specification is a i3 2100, 4GB ram and 2x2TB & 2x1TB of harddrives.

Thanks for any help. I hope this is posted in the correct place!


----------



## fonz (Jun 20, 2011)

smee204 said:
			
		

> - store and backup my documents, photos, music, tv, etc.
> - pvr functionality (maybe mythtv or tvheadend)
> - possibly replace my router and firewall
> - potentially small website host in future
> ...


FreeBSD can do all of that (although I personally haven't tried the TV thing yet). Whether it's the best choice probably depends on whom you ask 

Fonz


----------



## UNIXgod (Jun 20, 2011)

smee204 said:
			
		

> I currently have a linksys router running dd-wrt and wondered would it be better to get rid of this and use the server as a firewall and dhcp server etc? Would this be beneficial or am I best sticking with the router?
> 
> I was thinking the best option might be to run FreeBSD as my host OS for the ZFS and firewall functionality and run MythBuntu in a virtual machine for the pvr functionality. Is this the best way?



if you can run myth on FreeBSD look into FreeBSD jails before hitting the high level virtual machines. 
http://www.freebsd.org/doc/handbook/jails.html

FreeBSD has some great firewalls:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls.html

~


----------



## _martin (Jun 20, 2011)

Main difference between generic linksys router and your workstation is the power consumption and noise it makes. I don' t want to see an electric bill for that workstation going 24/7 every day. 

I can't say for mythtv, but everything else you named - FreeBSD has no problem with it. 

Personally I would like to see the performance results from running mythtv in virtual machine.


----------



## gkontos (Jun 21, 2011)

My only concern in your scenario is the firewall replacement. FreeBSD can become an excellent firewall and IDS but it is bad practice to run all the other services that you mentioned on a firewall.

My advice would be to start with the file sharing, media streaming and website development. In the future if you need to run a website you can consider an additional cheap box to play the firewall role and a jail in your first box.


----------



## carlton_draught (Jun 21, 2011)

UNIXgod said:
			
		

> if you can run myth on FreeBSD look into FreeBSD jails before hitting the high level virtual machines.
> http://www.freebsd.org/doc/handbook/jails.html


You bring up a good point. With VMs about the only thing you can't do AFAIK is 3D games. Maybe even that is changing. This means that if you have a sufficiently specced machine, you pick the host for the VM that is the best at fulfilling that duty. For each individual application, you either use the host machine or an OS on VM that is better suited to what you want to do. When you used bridged networking, there is no difference to running a VM vs a separate machine.

FreeBSD is one of the best if not the best choice for a host OS. The reason - it's possible to use ZFS to massively increase the data integrity over other options, while not sacrificing much in terms of ease of use. So provided VirtualBox does its job, ZFS will provide superior data integrity for the guest OS filesystems - which should work much better now they have a ZFS base rather than dealing with flaky HDDs directly. Any large collections of files should be kept on the FreeBSD side and accessed using shared folders (so that any VM can have access), which are very easy to setup. 

Because of the ability to run software on every other major OS easily, there is less of a requirement for the host OS to be as featureful, or as easy to use for a given desired feature. The main thing that matters is that it offers a solid foundation. Which FreeBSD + ZFS does in spades.

This is only going to become a more effective option as Intel and AMD keep upping the core count. At the moment, quad cores are pretty much standard. It is cheap enough to buy a decent quad core CPU and enough RAM for several VMs plus the 4GB or so you should probably allocate for your host system. This is far cheaper than buying individual motherboards, cases, PSUs, monitors, keyboards, mice, etc. for separate machines. And it means you can put money into buying quality components.

FreeBSD certainly has plenty of software by itself - 20k+ ports. And that should be the first (pardon the pun) port of call. When you add in the possibility to run things like Ubuntu with its even greater number software packages in repositories, or any other OS, it becomes very powerful.


----------



## carlton_draught (Jun 21, 2011)

gkontos said:
			
		

> My only concern in your scenario is the firewall replacement.
> FreeBSD can become an excellent firewall and IDS but it is bad practice to run all the other services that you mentioned in a firewall.


True. I'm glad you brought this up - firewalls should be a dedicated box IMO.



			
				matoatlantis said:
			
		

> Main difference between generic linksys router and your workstation is the power consumption and noise it makes. I don' t want to see an electric bill for that workstation going 24/7 every day.


This is becoming less and less an issue. See some figures for the Intel quad core E3-1240. Note that the total power draw of the _entire system_ is 37 Watts minimum (which is what your home machine will be doing 90+% of the time anyway). My modem router uses about 15W from memory. So there is not much difference, especially considering that once you have dedicated a core to a VM, the extra juice your home system uses is only 22W + power for HDDs.

If you get a good case such as the Antec P183 and possibly an aftermarket CPU cooler, your system should be near silent anyway.


----------



## smee204 (Jun 21, 2011)

Thanks for all the replies. Sounds like FreeBSD is ideal. The reason I asked about a firewall in FreeBSD was that my PC is on 24/7, so I thought I might as well reduce power consumption by getting rid of my router, as that uses about 15w. If that is not a good idea then I will hold off for now. I wondered if the firewall in FreeBSD is more secure than my linksys router?

I will have to experiment with mythtv and report back my findings. 

Thanks for the help.


----------



## vermaden (Jun 21, 2011)

matoatlantis said:
			
		

> Main difference between generic linksys router and your workstation is the power consumption and noise it makes. I don' t want to see an electric bill for that workstation going 24/7 every day.



That depends on hardware only, I for example have a dual core Intel T8100 CPU with a 965GM MINI-ITX motherboard along with 2 x 2TB drives to serve 2TB in a ZFS mirror and it consumes less then 40W, my fridge takes 20W and it's one of the most efficient ones with A+ class, so it only depends on the hardware.

For example take one of these:
Intel D945GSEJT --> Atom N270 1.6GHz (single core + HTT) + 945GSE
Intel D410PT -----> Atom D410 1.6GHz (single core + HTT) + NM10

Along with 1TB 2.5" drives it should be less then 15W in power consumption, but personally, I would rather go for Atom D510/D525 for dual core/quad thread then only a single core/dual thread.


----------



## Zare (Jun 21, 2011)

> With VMs about the only thing you can't do AFAIK is 3D games.



Even that is changing - with ESXi's direct PCIx passthrough, you can use a full-featured 3D accelerator inside a guest machine, and use direct KVM or RDP/VNC for access. Regarding VirtualBox, it's 3D features are nowhere near the capacity of playing sophisticated games inside guests. However, it really comes handy on desktop - there's no 2D acceleration outside of Windows guests, only 3D. GNOME desktop inside guests is far more responsive with Compiz/Emerald than with normal Metacity, because the former can use VirtualBox's acceleration features.


----------



## carlton_draught (Jun 21, 2011)

Zare said:
			
		

> Even that is changing - with ESXi's direct PCIx passthrough, you can use a full-featured 3D accelerator inside a guest machine, and use direct KVM or RDP/VNC for access.


That's pretty cool. I hope VMware eventually comes to FreeBSD. Who knows, now that ZFS on FreeBSD has matured to a great extent, maybe more people see the logic for using FreeBSD as a host OS. I suspect that more people will, especially since VirtualBox works perfectly for a lot of situations except for 3d games. If that sort of user-base grows, VMware can be expected to come to FreeBSD.


----------



## _martin (Jun 22, 2011)

No question it depends on hardware. It's just maybe I have a different picture in mind when somebody says workstation ;-)

@vermaden: That's actually pretty nice. I was thinking building myself a home NAS on FreeBSD/ZFS. Mini-ITX with a passive power supply. 
How much RAM do you have in it? I was wondering about performance; specially when you have a lot of I/Os on it (== active LAN connection, several ftp pushs, torrents, etc.)


----------



## vermaden (Jun 22, 2011)

matoatlantis said:
			
		

> @vermaden: That's actually pretty nice. I was thinking building myself a home NAS on FreeBSD/ZFS. Mini-ITX with a passive power supply.
> How much RAM do you have in it? I was wondering about performance; specially when you have a lot of I/Os on it (== active LAN connection, several ftp pushs, torrents, etc.)



Currently ... 1GB.

I use transmission there along with samba and NFS, video/audio streaming across entire WiFi network works very well, I do not have any performance nor stability problems, but 1GB may be little too less for DEDUP at v28 in the latest STABLE, I also have to test its efficiency for my pool, which is currently 93% full.


----------



## _martin (Jun 23, 2011)

vermaden said:
			
		

> I do not have any performance nor stability problems



That's great. Reason why I'm asking is due to the problem I have on my server. I have an amd64 8.2-RELEASE with 6GB of RAM and two v15 zfs pools - one 160GB mirror and one 4TB raiz5 array. Everything works OK, but it's just impossible to get an uptime of this server more than 4 months. Describing the situation is not the point of this thread, but I was curious about the stability of the system you're using.


----------



## vermaden (Jun 24, 2011)

@matoatlantis

I am not able to achieve such uptime because of random power problems, it's just a home NAS, so no UPS there, and as usual, power is sometimes gone, currently it's 20 days up, but who knows when power will be gone.


----------



## monkeyboy (Jun 29, 2011)

With FreeBSD, I've had uptimes greater than 2 YEARS. Usually a power supply fan dies and needs to be replaced. Almost never is there an actual problem with FreeBSD that necessitates a reboot.I'm not using ZFS though.


----------

