Moving VM from VirtualBox to Hyper-V

I see that many people are using FreePBX with Hyper-V.

We have a new server and need to migrate the existing VirtualBox VM to Hyper-V. I have converted the file to VHD format and started it up under Hyper-V - and it fails to boot.

I have seen mention of using the Legacy NIC option and done that but no difference - as expected - as the boot fails before it gets anywhere near that.

I can’t get a clear idea of the issue as I find it impossible to get at the log messages. All I have is the final page Capture
What seems to be relevant are the following warnings:

Could not boot
/dev/SangomaVG/root does not exist
/dev/SangomaVG/swaplv1 does not exist
/dev/mapper/SangomaVG-root does not exist

I’m new to Hyper-V so don’t really know what to change in the settings.

I would be grateful for any pointers.

Many thanks

Just looked it up for you…

Very much appreciate the quick response. Unfortunately …

The very last part is the bit that is of interest to me - the actual Hyper-V options. All that it shows is using the default setting and bingo it works.

Unfortunately for me that does not work.

Not a HyperV expert either.

What version of FreePBX is this?

Did you look at the logs?

Quite an up to date V14.

But that is irrelevant at the moment. The VM can’t boot as it appears not to find the boot partitions.

I’m not sure what the error messages:

Could not boot
/dev/SangomaVG/root does not exist
/dev/SangomaVG/swaplv1 does not exist
/dev/mapper/SangomaVG-root does not exist

mean but it looks like boot areas.

It seems to me that this is more a CentOS issue than a FreePBX issue.

IIRC you’ll have to use the fsck or e2fsck for the machine to be able to read the block.

If it is a damaged disk it will be simpler to just create a new VM from the distro iso.

I just assumed this was all due to my ignorance of hyper-v setup. But if noone with h-v experience turns up soon I will start from scratch.

All the responses are much appreciated.

just curious…why do you want to move from virtualbox to hyper-v? If it is a Windows server issue, why not use an extra Intel NUC with e.g. Linux Mint for the freePBX VM?

Can’t help you with this…but once you do get it running…keep in mind you will need to deal with activating your installation as well…unless somehow you are migrating to a solution with the same mac address. (-;

Because the powers that be have installed a server where the whole server is a hyper-v VM. I don’t know the technical names, but they installed some minimal MS server OS without a gui and everything is a hyper-v. Virtualbox will not run in a h-v VM - unfortunately.

I would be much happier sticking with Virtualbox.

Is re-activating an issue? I think I could set the MAC to anything I want.

You are correct.

The proper way is to call them and you explain what you did, and they will reissue an activation. I think it reduces your Zend count by one though.

However, always good to remember what the original mac was. (-;


As PitzKey comment, I also think that it is more the theme of centos than of FreePBX.
I would opt for some problem with grub and the LVM volumes for the hardware change.

I would check the Logical Volumes and the Grub settings.

You can get a list of the logical volumes of the system:
# lvs -o vg_name,lv_name
SangomaVG root
SangomaVG swaplv1

And check that in grub are well configured:
[[email protected] ~]# vi /etc/default/grub
GRUB_CMDLINE_LINUX="crashkernel=auto biosdevname=0 net.ifnames=0 rhgb quiet"

Since it does not boot the system, you could use ubuntu to check it.

Finally, you would have to reregister the grub configuration with grub2-mkconfig

Many thanks for the detailed suggestions.

I’m hoping that I can get away with a fresh install - I’m waiting for the server people to get the distro into the right place on the server so I can install it.

Failing that I will have a go per your post.

Is there a reason you are recommending a consumer level mini-PC and a Linux OS designed and geared to be a desktop OS? Why are there consumer level recommendations for a business level operation where a server, physical or virtual, is a better option? Why are we not recommending the Distro install that comes with full support? Let alone the suggestion on installing things on an OS that there are no proven, validated and tested install instructions for a Manual Install.

They also have an existing FreePBX box so this recommendation can pretty much stop the use of any commercial modules that could exist (like System Admin) and nullify any support they might be dependent on.

1 Like

Because he obviously has a virtualbox VM, which works…and because I have been using Intel NUCs with Linux Mint and freePBX VMs (=distro install)…for several years…cant complain…and I usually complain a lot :wink:
It’s easier to move a virtualbox machine to a different os platform (host) than to convert it to e.g. hyper-v.

You cannot have a distro install on Linux Mint, it’s not possible. The Distro will install its own OS based on RHEL7 which is also what the encoder/loader is based on for commercial modules. Debian/Ubuntu and other non-RHEL7 OS’s do not support the Distro which means everything is a manual install.

Virtualbox is just like other VM hosts. It has numerous host OS options and supports a wide variety of guest OSes along with allowing you to install from your own ISOs. Much like Hyper-V.

Also the OP has shown concerns about re-activation, something that if using a non-Distro install wouldn’t be a worry since you can’t active those boxes (no System Admin support). Plus the statement of waiting for the ISO to be on the network to install.

So far nothing points to just firing up a new VM on a non-Distro supported OS will be the right answer.

Somehow…you got it wrong…
Yes, if you download a freePBX distro file and install it onto a virtualbox machine, its a distro installation…and of course it uses the OS, Sangoma provides…this is the virtualbox GUEST!
The virtualbox HOST, in my case, is an Intel NUC with Linux Mint. This combo has been a stable solution for years…I have two of them…

If one already has a freePBX virtualbox image, but cannot use it anymore, because the server OS doesn’t support virtualbox, it might be easier to move the VM to an extra inexpensive Mini-PC.

1 Like

Hello Les,

You need to generate a new initramfs. The following should fix it for you:

Attach a Centos 7 ISO to your Hyper-V guest VM.

Boot into rescue mode

mount --bind /run /mnt/sysimage/run

systemctl start multipathd.service

chroot /mnt/sysimage

dracut –regenerate-all --force

I will try to do this over the weekend