Migrate jail system to fully virtualized system like qemu

ro

Member


Messages: 29

Hi.

I have legacy (FreeBSD 7.4) bare metal host with jail in it.
Is it possible to move jail from this host into qemu virtual maschine by coping jail file system and kernel from host system?

Is it necessary to do anything else besides such copy?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,680
Messages: 30,598

Why do you have a need for a version that's been EoL for more than 6 years?
 
OP
OP
ro

ro

Member


Messages: 29

In ugly commercial software reasons on this host.
I have no chance to update system without brake this software =(
 
OP
OP
ro

ro

Member


Messages: 29

This software was written by request. Software support is no longer being implemented. We have no sources
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,680
Messages: 30,598

Have you tried running it on a recent version by using misc/compat7x for example?
 
OP
OP
ro

ro

Member


Messages: 29

Problen with this software is not it binary compatibility, but in library dependencies
I can't update the existing environment
 
OP
OP
ro

ro

Member


Messages: 29

You surprised me. I didn't know about misс/compat*. I will try, thanks.
But I want to remove the jail regardless of success. Сould You answer the main question of the topic?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,680
Messages: 30,598

I think it'll be easier if you do a clean install on the VM. Then move the application over. Just copying the files doesn't create the boot sector and swap for example. But you could do those by hand too. Set up the partitions, boot info, etc, then copy the files. Be careful though, there are lots of hard-linked files, a "plain" copy would break those and create independent files instead.
 

gkontos

Daemon

Reaction score: 480
Messages: 2,153

Hi.

I have legacy (FreeBSD 7.4) bare metal host with jail in it.
Is it possible to move jail from this host into qemu virtual maschine by coping jail file system and kernel from host system?

Is it necessary to do anything else besides such copy?
Yes, you can copy the Jail to a FreeBSD 12.0-RELEASE host physical or virtual. All you need to have is misc/compat7x installed on the host system.

You will need to adjust the rc.conf of the host system so that the jail can start properly
 

_martin

Aspiring Daemon

Reaction score: 165
Messages: 798

For the sake of the OP's original question: moving to qemu is possible. It all depends on the setup within the 7.4 system. But generally it's easier to first install FreeBSD and then move the application to it. My assumpiton: qemu host has graphics output. If not, you can play with the -console, -vnc and alike options to get the job done.

On a qemu host you could do the following:

Download the old FreeBSD from the archive here.
Prepare the virtual disk: qemu-img create -f qcow2 qbsd7.qcow2 10g
Launch the FreeBSD installer: qemu-system-x86_64 -hda qbsd7.qcow2 -cdrom FreeBSD-7.4-RELEASE-amd64-disc1.iso

Follow through the installation process and boot to the newly installed system. Then you can start migrating the application from old physical system to new virtual.
There's also an option to play with the virtio drivers to get the better performance out of it (I don't know if virtio drivers are supported on 7.4)

Again, there are more ways to skin a cat, this is one of them.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,680
Messages: 30,598

Yes, you can copy the Jail to a FreeBSD 12.0-RELEASE host physical or virtual. All you need to have is misc/compat7x installed on the host system.
To be complete, you actually need all these too:
misc/compat7x
misc/compat8x
misc/compat9x
misc/compat10x
misc/compat11x

7x is for running 7 binaries on 8, 8x is for 8 binaries on 9, etc. You need to "fill" this all the way to N-1, where N is the major version you have. The same is true for the required kernel options, COMPAT_FREEBSD7, COMPAT_FREEBSD8, etc.
 
OP
OP
ro

ro

Member


Messages: 29

Great thanks for all for help one more time.
I've run this jail in kvm virtual machine.

Best regards
 

teo

Well-Known Member

Reaction score: 11
Messages: 482

There's also an option to play with the virtio drivers to get the better performance out of it (I don't know if virtio drivers are supported on 7.4)
Hello _martin, a little question, does qemu libraries serve as (devices, audio, copy/paste, folder) with FreeBSD as guest system?
 

_martin

Aspiring Daemon

Reaction score: 165
Messages: 798

does qemu libraries serve as (devices, audio, copy/paste, folder)
Not sure what you mean by that. You can define various types of devices within qemu instance. However all my FreeBSD machines are headless so I don't have any experience with setting up desktop-related features in qemu on FreeBSD.
 
Top