# FreeBSD on Amazon EC2



## matthew (Nov 17, 2008)

Anyone managed to run FreeBSD successfully on Amazon's EC2?

[ Skip to post #31 at http://forums.freebsd.org/showthread.php?p=114620#post114620 for a 'Yes' reply -- Mod ]


----------



## cpeterson (Nov 23, 2008)

At meetBSD Kip Macy mentioned that Amazon either needs to upgrade the version of Xen used to run EC2 to 3.3 (I think, number may be wrong), or else he'd have to commit a very, very ugly patch to make freeBSD's memory management system work on the older Xen they run.

So at the moment the answer is not easily.


----------



## Dum_Dum (Mar 14, 2009)

Brought this thread back from the dead.

According to Amazon their new EC2 "Reserved Instances" support FreeBSD:

http://aws.amazon.com/ec2/faqs/

"Q: What operating system environments are supported?

    Amazon EC2 currently supports a variety of operating systems including: RedHat Linux, Windows Server, openSuSE Linux, Fedora, Debian, OpenSolaris, Cent OS, Gentoo Linux, Oracle Linux, and FreeBSD. We are looking for ways to expand it to other platforms in future releases."

I have yet to see any public AMI's!


----------



## df-sean (Jul 10, 2009)

So *nobody* on Earth is running FreeBSD on AWS? 

Anyone? Hello?


----------



## gionata (Jul 24, 2009)

df-sean said:
			
		

> So *nobody* on Earth is running FreeBSD on AWS?
> 
> Anyone? Hello?



I just did a fresh install on a server using 7.2 and I am trying to build the AMI myself even though the amazon documentation about the process isn't great (the example for creating a new AMI is using a fedora server and I get confused when see yum configuration files all over the place).

If i do manage to build it and upload it I'll give you a shout and you might then take the AMI down and modify it.


----------



## Mikael (Jan 2, 2010)

Any news on this? (I hope it's okay that I bump this thread.)


----------



## ekool (Jan 12, 2010)

Subscribing, need this as well.


----------



## df-sean (Jan 14, 2010)

Hmmmm... I guess this is just never gonna happen. Beginning to lose hope :-(


----------



## aragon (Jan 15, 2010)

Well, those who need it, why don't you hassle Amazon to upgrade their Xen?


----------



## starjar (Jan 17, 2010)

aragon said:
			
		

> Well, those who need it, why don't you hassle Amazon to upgrade their Xen?








got answer?


----------



## randi@ (Feb 1, 2010)

I've been speaking with Jeff Barr @ Amazon of the renewed public interest in FreeBSD on Amazon EC2. He said he was going to pass this on to the EC2 team - that there's still a demand for it, and that we do have a developer to work on it (apparently this is a good sign). 

As I see it, there are two options. We can either cross our fingers and hope that Amazon does see the value of FreeBSD on EC2 and takes steps to help us, or we can work on finding companies and people that are interested enough in seeing this work that they are willing to pay someone to do the work. I'm still working on getting a quote for how much time/money this is going to take.


----------



## jdereus (Mar 5, 2010)

*hack it?*

Has anyone tried 'depenguinator' ?

or is this technically impossible?


----------



## jdereus (Mar 7, 2010)

In the mean time, this is a competitor that offers FreeBSD installation, and a 5-day free trial.

http://www.elastichosts.com/


----------



## RkG (Mar 17, 2010)

jdereus said:
			
		

> In the mean time, this is a competitor that offers FreeBSD installation, and a 5-day free trial.
> http://www.elastichosts.com/



Hi, first hello all I'm a (freelance) FreeBSD's server admin since one year ago, more or less, I've been several years using OpenBSD in my own servers, OpenBSD is an OS that also like a lot, but last year I found out that FreeBSD fits my needs (generally) quite better.

I've been searching for a cloud solution based on FreeBSD last weeks and sadly I've found nothing useful for my needs, I've tried elastichosts.com but the hard disks' IO ratio is a pain, LESS than 1 MB/s with a 

```
$ dd if=/dev/zero of=test_file bs=64K count=1K
```

The curious thing is that this isn't a specifical BSD behavior, installed a CentOS distribution in another V-host with almost the same results in my little test, also I've wrote a week ago to the technical department and no answer, I resend it to the sales dp...

So for me, right now there's no alternative here in Europe to explore the cloud via FreeBSD


----------



## jdereus (Mar 22, 2010)

Reliacloud is not situated in Europe, but in Minnesota. 

It has way better pricing on bandwidth than elastichosts.
(http://www.reliacloud.com/pricing)

I just hope the performance is good. Does anyone have experience with this supplier?


----------



## RkG (Mar 24, 2010)

jdereus said:
			
		

> Reliacloud is not situated in Europe, but in Minnesota.
> It has way better pricing on bandwidth than elastichosts.
> (http://www.reliacloud.com/pricing)



I've done a quick lookup, it looks nice, the first (and definitive) problem I've found is that Relicloud isn't in the Safe Harbor list, this is a legal requirement here to export any personal data to the USA. So no luck by the moment..


----------



## jdereus (Mar 29, 2010)

Thanks RkG, I really didn't know.


----------



## dave (Mar 30, 2010)

For those that don't want to wait, a word of encouragement...

I did not want to wait for FreeBSD to move my (small) web server to the EC2 - I needed the cost savings ASAP.

I reviewed (at length) this thread to try and decide which Linux might be best for a FreeBSD lover.  Sadly, threads like those end up filled with useless remarks.  But after spending ages wading through the "I like FreeBSD" submissions, I decided to try Debian.

It was pretty easy to set up, and virtually everything I needed in terms of instruction was to be found easily on Google.  It did not take long at all.  I used Debian 5 Lenny on EBS.

A couple of tips come to mind:

1. Start/Stop Service scripts are in /etc/init.d/

2. Although there are AMIs with LAMP setups ready-made, chances are you will want to grab a base image, as you will likely want to update everything anyway.

3. Sending mail from your web apps can be tricky.  It's fairly easy to set up ssmtp to send via a Google Apps account, but if you want to use custom "From:" addresses, check here.  Note that due to AWS IPs being considered spammy, you should configure an SPF record if you want to mail directly from your virtual server.

I guess that's all for now...

I have reduced my hosting costs for web service by 75% _AND_ I no longer have to pay for or worry about the hardware!


----------



## RkG (Mar 31, 2010)

dave said:
			
		

> I reviewed (at length) this thread to try and decide which Linux might be best for a FreeBSD lover.  Sadly, threads like those end up filled with useless remarks.  But after spending ages wading through the "I like FreeBSD" submissions, I decided to try Debian.



Personally, if someday I'm trying some Linux for servers, I'll go with Arch Linux, it has, like FreeBSD both install methods easily available, "ports" and packages, and IMO is the closest Linux distribution to FreeBSD philosophy. But by now I prefer to wait, (even it makes me spend more money that I want renting a physical server), I don't wanna loose Jails, Packet Filter, the wonderful tools to admin packages (portinstall & portupgrade), ZFS...  Of course, Debian is a great server's distro also...


----------



## df-sean (Apr 1, 2010)

I'll chime in... I also went with Debian 5 in the absence of FreeBSD. I have to say that overall, I'm very pleased with it. The minimal install leaves you with a very clean launchpad (which is one of the big attractions of FreeBSD for me).

The apt-get system is of course awesome. I'd go so far as to say that I like some aspects of Debian better than FreeBSD. At the end of the day, I'll continue to use and love FreeBSD wherever possible. But wherever not possible (like EC2 for now at least), I'll happily use Debian.


----------



## pbgc (Apr 13, 2010)

@RkG


> I've tried elastichosts.com but the hard disks' IO ratio is a pain, LESS than 1 MB/s with a
> 
> ```
> $ dd if=/dev/zero of=test_file bs=64K count=1K
> ...



I've been using ElasticHosts with FreeBSD 7.3 (I think they have also 8.0 available now) for a month now and I must say that I'm very happy with the performance of my V-Server and their services in general!
Something strange happened with your trial... because one of the things that really made me keep with ElasticHosts after the trial was their timely answers to my support/sales questions while I was evaluating!


----------



## alanj (May 11, 2010)

Anyone got an update to this?


----------



## acg (Jul 15, 2010)

*EC2 user-provided linux kernels could launch FreeBSD?*



			
				gionata said:
			
		

> I just did a fresh install on a server using 7.2 and I am trying to build the AMI myself even though the amazon documentation about the process isn't great (the example for creating a new AMI is using a fedora server and I get confused when see yum configuration files all over the place).
> 
> If i do manage to build it and upload it I'll give you a shout and you might then take the AMI down and modify it.



EC2 just announced support for user-provided linux kernels: http://aws.typepad.com/aws/2010/07/use-your-own-kernel-with-amazon-ec2.html

"You could (if you are sufficiently adept) use this facility to launch an operating system that we don't support directly (e.g. FreeBSD)."

Does this get us closer?


----------



## mfeldheim (Jul 30, 2010)

sure it does - you can now boot a ec2 instance (almost) just like you boot a physical or virtual machine.

Here's a guide provided by amazon
http://ec2-downloads.s3.amazonaws.com/user_specified_kernels.pdf

"To be compatible with EC2, a Linux kernel must support Xen's pv_ops (paravirtual ops) infrastructure with XSAVE disabled or the Xen 3.0.2 interface."

Dunno, if Xen is still a problem tho


----------



## Slade (Jul 31, 2010)

If you check the freebsd xen mailing list there are some problems with stability with xen/paravirtualization and freebsd. I have run into some problems firsthand although most of it seems to crop up under heavy load.

There are other options out there in regards to using hardware virtualization to setup a freebsd vps. If people want some suggestions you can pm me since I don't want to turn this into an ad for anyone. 

True "cloud" options seem to be on the horizon though. If you aren't keeping up with trends Xen is having some problems because it's not part of the linux kernel. This is forcing more hosts to go to something like citrix xen or KVM. KVM is being backed by Red Hat and IBM. The good thing about KVM besides being part of the linux kernel is that it's hardware virtualization. This means you can easily load pretty much any OS you want without any modifications. So with a KVM based cloud you can install freebsd with an unmodified kernel and be up and running very shortly. So by the end of the year I think there will be a lot more options in regards to where you can run FreeBSD in the cloud.

Here is a good article on this topic:

http://searchservervirtualization.t...0,289142,sid94_gci1516376,00.html?track=sy420


----------



## jeffbarr (Sep 8, 2010)

The EC2 Cluster Compute Instances support KVM:

http://aws.typepad.com/aws/2010/07/...stance-type-the-cluster-compute-instance.html


----------



## cloudsigma (Oct 28, 2010)

Just to add a vendor perspective to the discussion. We are a public IaaS cloud provider based in Zurich, Switzerland and do support FreeBSD without issue. In fact we have a number of customers using FreeBSD 8.1 to run ZFS clusters and more. 

You can find out more information on FreeBSD and our cloud at http://cloudsigma.com/en/cloud-computing/advantages-of-cloud-computing/179 .

Best wishes,

Patrick
CEO
CloudSigma
http://www.cloudsigma.com
http://www.twitter.com/CloudSigma


----------



## jdereus (Oct 29, 2010)

Here's a new Dutch provider of FreeBSD 8.1 systems: http://www.tilaa.nl

I'm a happy customer


----------



## Matty (Oct 31, 2010)

jdereus said:
			
		

> Here's a new Dutch provider of FreeBSD 8.1 systems: http://www.tilaa.nl
> 
> I'm a happy customer





> FreeBSD doesn't have paravirtualized network and block drivers for KVM, which means FreeBSD has less than optimal performance. In practise it works quite well, but if high performance is a requirement for your application we currently recommend a Linux based OS.
> There appears to be a regression in KVM with regard to ACPI events. For some reason the ACPI power button event is not received by the FreeBSD guest. This effectively means you can't gracefully shutdown your FreeBSD VPS from our webapp. We expect this issue to be fixed soon-ish.
> We can't resize the FreeBSD UFS filesystem from the Linux host, nor does the FreeBSD growfs command support online resizing. This makes it difficult if not impossible to properly automate resizing of FreeBSD guests. If you want to upgrade your FreeBSD VPS later on, be aware that the filesystems will not be resized. (Our webapp will give a warning about this.) If you want to start using the extra assigned disk space, contact us and we'll grow your filesystem manually.



Too bad they don't sell jails. Instead it's FreeBSD on KVM :\


----------



## minimike (Nov 20, 2010)

You can ask me  for a Jail. I hope that I can start up with my Startup on the first January. Currently I have to decide me between NetBSD with XEN, Scientific Linux with XEN or a pure FreeBSD with VIMAGE. They will be boxes with two Opterons, up to 64 GB Memory and fast SAS drives.


----------



## acg (Dec 13, 2010)

Colin Percival has just announced that FreeBSD 9.0-CURRENT can now run on EC2. Still a work in progress, but awesome news!

http://www.daemonology.net/blog/2010-12-13-FreeBSD-on-EC2.html


----------



## dave (Dec 13, 2010)

*Running FreeBSD on Amazon EC2*

Information:
http://www.daemonology.net/blog/2010-12-13-FreeBSD-on-EC2.html
http://www.daemonology.net/freebsd-on-ec2/

AMI: ami-c01aeca9

To Connect:
1. Once you have started an instance, click on your running instance in the console and copy the Public DNS to your clipboard.
2. Execute the following command, making substitutions for items in bold:


```
ssh -i [i][b]path to your .pem file[/i][/b] root@[i][b]Your Public DNS Name[/b][/i]
```

3. *Remember:* this is only for 9.0 CURRENT and still in the experimental stages, so deployment of production systems is not recommended.


----------



## dave (Jun 10, 2011)

*Anyone Using The EC2?*

Is anyone else using the EC2 micro instances?  I have been, with much success, and am happy to see that there is now an 8.2-RELEASE AMI.  Thanks, Colin!

I was trying to add some EBS storage today and ran into some trouble.  My instance crashed and dumped core.  I'm wondering if anyone else has been able to add extra storage, beyond the 10G that are available in the AMIs?

Thanks.


----------



## dave (Jun 11, 2011)

*EC2: Adding EBS Disks To A Running Instance*

Going to answer my own question here.

Colin emailed me with the following info:



> This is a bug in fdisk.  There is a simple workaround: Don't use fdisk --
> there's really no point given that you can create as many virtual disks
> as you want using EBS.  Just newfs and mount the raw EBS disks.



So, once you create an EBS Volume and attach it to your running instance, tail your /var/log/messages and you will see the device name assigned by the kernel:


```
Jun 10 15:55:37 yourhost kernel: xbd2: 10240MB <Virtual Block Device> at device/vbd/2080 on xenbusb_front0
Jun 10 15:55:37 yourhost kernel: xbd2: attaching as da2
Jun 10 15:55:37 yourhost kernel: GEOM: new disk da2
```

..in this case, it's /dev/da2, So...


```
# newfs /dev/da2
# mkdir /ebs
# mount /dev/da2 /ebs
```

...now you have new storage you can access at /ebs.

Don't forget to add an entry in /etc/fstab if you want to mount it at boot:


```
/dev/da2 /ebs ufs rw 0 2
```


----------



## mfeldheim (Jun 11, 2011)

I am using Micro Instances a lot for all the small tasks you don't need or don't want to have on your productive machines. Micro Instances - at least in my case - also do a great job as loadbalancing reverse proxies.

An attached EBS harddisk cannot be seen like a physical HDD. You can use it just like any RAW block device.
RAID works great actually - tried RAID0 and got a real performance boost surprisingly. Should use RAID5 or 10 / 01 for mission critical data of course.

Tip: EBS has some sort of lazy physical space allocation mechanism which (extremely) slows down the first write on each virtual block. 

*dd if=/dev/zero* the complete disk before you are using it for the first time takes ages but helps big time.


----------



## inetassociation (Aug 13, 2011)

Amazon AWS EC2 FreeBSD Micro images (micro only) have a bug related to the fstab file. Seems that when you edit fstab and reboot the virtual server then it does not complete reboot. It hangs due to panic over the edited entry in the fstab that related to newly attached volumes. Since reboot stops when it panics the IP does not come up. Users need to launce a new instance as a work around... which is a large pain in the rear.


----------



## dave (Dec 4, 2011)

Is there an ETA for AMIs in the new Oregon (us-west-2) region?  Is there a way I can move one from us-west-1?  Any info on this would be appreciated.


----------



## vand777 (Jan 1, 2012)

How to install FreeBSD 8.2 RELEASE i386 in Amazon EC2, patch all security holes and install packages built on your build server.


----------



## dave (Oct 27, 2012)

for the record, I was able to migrate a machine to a different region using dump and restore, using these steps:

1. Attach and mount a separate disk from your root disk
2. Stop services, and do a dump backup of your root dir to a file on the other disk
3. Start an instance of the same type in the remote region (New)
4. Start another insance of the same type in the remote region (Temp)
5. Copy the dump file from the original machine to the Temp instance
6. Shutdown (Stop) the New instance.
7. Detach the main drive from the new instance and attach it to the Temp instance.
8. On the Temp instance, mount the boot drive from the New instance.
9. On the Temp instance, cd into the mount point for the New instance's boot drive
10. Restore the dump file into the root of the New instance's drive
11. Unmount and and detach the New instance's boot drive from the Temp instance.
12. Re-attach the New instance's boot drive to the New instance.  Type: /dev/sda1 as the device name.
13. Boot the new instance.


----------

