Friday, February 6, 2015

Install pfSense on XenServer Part 2

The process is going to take a while, so sit back until you see your pfSense VM available.


And of course the first thing we're going to do is add the NIC that we weren't allowed to when importing.


Time to boot up our pfSense. Once booted, it will notify that the previous NICs do not exist, but new ones do. Make sure you assign the correct ones, checking your MAC addresses from XenCenter's "Networking" Tab:





And that should be all there is to it. There's a chance a hard disk or NIC device changes its name after an update, but nothing we can't handle.




Install pfSense on XenServer Part 1

In this post I'll walk through the steps required to install pfSense (and pretty much any other OS for that matter) on XenServer. And this is because we're going to cheat. That's right.

It's really easy in principle: Install Oracle VirtualBox on your PC, create your virtual machine there and import it. Done. If you feel confident enough, go ahead and do it yourself but I'm going to actually go through it, as it has 1 or 2 things that if you don't get right, you might end up with problems.

On with it then:

Step 1: Install pfSense on a VirtualBox VM:




While creating the VM, the important part is making sure your hard drive file type is importable by XenServer. Select VMDK and you can't go wrong.


 

Add the same number of NICs that your VM in your XenServer will have. This step is not as important as the others, but that's how I do it. In this case, I only have WAN/LAN interfaces so I only need two.




Don't forget to add a pfSense ISO in the CDROM of your VM


After that, boot it up and follow the install screen. After the pfSense installation is finished, go ahead and configure your IPs as they would appear in your XenServer VM.


Here's another important detail: Go to the pfSense's shell and type:

/usr/local/sbin/ufslabels.sh

This command converts /etc/fstab entries to UFS labels rather than disk device names. This is useful because in case of an upgrade, the disk device names might change and you might get stuck with an unbootable pfSense until you try and resolve the issue.



We're done with VirtualBox so halt the system. it's time to import it to XenServer.


The process is rather easy, but it's included here for completess' sake:





At this point, you will only have only one network as an option to add. No worries, we'll just select one of the correct NICs and add the second one later.
 


Don't worry about OS fixups. Just continue.




This is getting graphics heavy, so I'm going to make this a 2-part post.

Wednesday, February 4, 2015

XenServer The bootloader for this VM returned an error Unable to access a required file in the specified repository: file:///tmp/cdrom-repo


Lovely, yes? It reads: Error: Starting VM 'Ubuntu Precise Pangolin 12.04 (64-bit) (2)' - The bootloader for this VM returned an error -- did the VM installation succeed?  INVALID_SOURCE
Unable to access a required file in the specified repository: file:///tmp/cdrom-repo-cHT3xP/install/vmlinuz.

What this means in simple terms is that the Virtual Machine is not configured to boot from an ISO.

[root@xenserver-aipuwzhh ~]# xe vm-list 
uuid ( RO)           : f5870ba2-c405-56a9-8022-41ca4fc362a1
     name-label ( RW): Ubuntu Precise Pangolin 12.04 (64-bit) (2)
    power-state ( RO): halted


uuid ( RO)           : 77c6963c-fb55-48e2-a799-82ea166d0748
     name-label ( RW): Control domain on host: xenserver-aipuwzhh
    power-state ( RO): running


uuid ( RO)           : 89ddbb9d-4c9e-16c6-1349-ba9b5babae0b
     name-label ( RW): Ubuntu Precise Pangolin 12.04 (64-bit) (1)
    power-state ( RO): running

As we already know, the VM I want to "fix" in my case is the Ubuntu Precise Pangolin 12.04 (64-bit) (2), with the uuid f5870ba2-c405-56a9-8022-41ca4fc362a1. On with the fix then:

[root@xenserver-aipuwzhh ~]# xe vm-param-set uuid=f5870ba2-c405-56a9-8022-41ca4fc362a1 HVM-boot-policy=BIOS\ order HVM-boot-params:order=dc

Drumroll please...


Great stuff.