# Install Linux CentOS7 or Debian in FreeBSD



## antolap (Dec 1, 2017)

Which is the easiest way to use a basic CentOS7 (text way) inside  FreeBSD?
For me it's ok also if I can chroot inside a directory and then use Linux.
I don't want to use virtualbox or a heavy virtualization system.

Thanks


----------



## ondra_knezour (Dec 1, 2017)

See Linux Binary Compatibility in the Handbook and the emulators/linux-c7 port.


----------



## SirDice (Dec 1, 2017)

Another option is bhyve(8) (I can recommend using sysutils/vm-bhyve to manage it). It is a virtualization system but it's not "heavy". It does require certain CPU features though.


----------



## antolap (Dec 1, 2017)

I don't understand if I can install for example debian base system inside a directory, and then I chroot inside and I can use apt-get and install software inside that system


----------



## SirDice (Dec 1, 2017)

FreeBSD is not a Linux, so you cannot run Linux stuff directly on FreeBSD. In order to be able to do that you require the Linux compatibility layer. But as this is, in essence, an emulation it's not going to be 100% compatible. If you need 100% compatibility using a virtual machine is a better solution.


----------



## antolap (Dec 1, 2017)

> Another option is bhyve(8)



No, it gives me an error:
/usr/local/sbin/vm: ERROR: it doesn't look like your cpu supports bhyve (missing EPT)

can't I do anything with bhyve, right?


----------



## SirDice (Dec 1, 2017)

What CPU does the machine have? It does indeed require certain features to work and your CPU appears to be lacking the most important one.


----------



## antolap (Dec 1, 2017)

`hw.machine: amd64
hw.model: Intel(R) Xeon(R) CPU           W3550  @ 3.07GHz
hw.ncpu: 4
hw.machine_arch: amd64`


----------



## ondra_knezour (Dec 1, 2017)

Your system should support EPT (Intel® VT-x with Extended Page Tables), it is probably just disabled in BIOS.


----------



## antolap (Dec 1, 2017)

In the BIOS all options for virtualizations are enabled.. I don't know

this is my dmesg, if you want to check
https://paste.debian.net/plain/998582


----------



## ondra_knezour (Dec 1, 2017)

Looks like the EPT and POPCNT flags are present. Do you have the vmm.ko module loaded?

I would check troubleshooting section here https://wiki.freebsd.org/bhyve and also availability of any BIOS upgrades for your motherboard, which may also contain CPU microcode updates. YMMV, but I had succeeded many times just with flashing newer BIOS when I had problems with hot new features at given time like UEFI or virtualization. On the other hand, I also bricked several expensive boards this way and have to resort to external flash programmer and/or the vendor support department


----------



## antolap (Dec 1, 2017)

ondra_knezour said:


> Looks like the EPT and POPCNT flags are present. Do you have the vmm.ko module loaded?


yes



ondra_knezour said:


> I would check troubleshooting section here https://wiki.freebsd.org/bhyve and also availability of any BIOS upgrades for your motherboard, which may also contain CPU microcode updates.


I have the latest bios


----------



## ondra_knezour (Dec 1, 2017)

I am out of ideas here, but you may have better luck asking at freebsd-virtualization@ list.


----------



## grehan@ (Dec 2, 2017)

The W3550 is a Nehalem ("Bloomfield" model) so doesn't support the 'unrestricted guest' VT-x feature aka UG, which is required by bhyve to boot Linux guests.

UG didn't arrive until Westmere, the Nehalem follow-on model.

For Nehalems, at best you can boot single-processor 64-bit FreeBSD guests.


----------



## antolap (Dec 2, 2017)

and what about my laptop processor:
laptop hp 250 g5 processor i5 7200u
If I install FreeBSD will byhave work?


----------



## grehan@ (Dec 3, 2017)

That will work fine (in general, any Intel CPU >= 2010's Westmere won't have any problems).


----------

