Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #233377

Re: Running a FreeBSD guest

From Dan Ritter <dsr@randomstring.org>
Newsgroups linux.debian.user
Subject Re: Running a FreeBSD guest
Date 2021-03-23 11:50 +0100
Message-ID <BVMLL-7ke-7@gated-at.bofh.it> (permalink)
References <BVEXU-2t1-3@gated-at.bofh.it> <BVGwG-3yw-5@gated-at.bofh.it> <BVLZo-6Jk-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Victor Sudakov wrote: 
> Robbi Nespu wrote:
> > On 3/23/21 10:20 AM, Victor Sudakov wrote:
> > > Dear Colleagues,
> > > 
> > > What's the minimum software kit to run a couple of FreeBSD guests
> > > (serial console, no graphics needed) on a Debian 10 host?
> > > 
> > > I don't need any fancy management GUI like that of VirtualBox, would
> > > just prefer some minimalistic hypervisor managed from the CLI. The
> > > ability to access the host's raw disk devices from the guest would be a
> > > great advantage.
> > > 
> > > Please don't just say "kvm" or any other single word but give a pointer
> > > to a good step-by-step document.
> > > 
> > 
> > I think qemu is fast and simple,
> > 
> > $ qemu-img create freebsd.img 4G
> > 
> > $ qemu-system-x86_64 -hda freebsd.img -cdrom
> > FreeBSD-12.2-RELEASE-amd64-bootonly.iso -boot d -m 512
> > 
> > do the installation and then try boot it with
> > 
> > $ qemu-system-x86_64 -hda freebsd.img -m 512
> 
> Really, a nice thing. Thank you. A couple of questions if you please:
> 
> 1. Does qemu use hardware virtualization (VT-d, whatever is in the CPU)?

If qemu-kvm is installed, yes, that will be the default. qemu
will fall back to emulation if a non-x86 guest is requested or
the CPU of the host is incapable.


> 2. Can qemu present the NIC and drives to the guest paravirtualized?
> FreeBSD understands VirtIO Block Adapter, VirtIO Ethernet and VMware
> VMXNET3 and some other paravirtualized devices.

Yes.

Most other tools for virtualization on Linux are built on top of
qemu/kvm, largely to expose features that qemu already has but
can required very long command lines, or to do management of
multiple VMs. The libvirtd infrastructure is probably the
simplest such management system. Although there is an X11 GUI
included with it, the command line tools can do everything.

Here's a typical non-libvirtd qemu/kvm invocation:

cd /var/spool/kvm
export VNAME=virtualmachinename
export CPUS=2
export RAM=4096
export MAC=00:15:f1:c1:a2:01
export VNC=:1
export IMAGE=/var/spool/kvm/images/$VNAME.img

kvm -m $RAM -smp $CPUS -name $VNAME -rtc base=utc -boot menu=on -drive file=$IMAGE,if=none,id=drive-virtio-disk0,boot=on,cache=writeback -device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0 -device virtio-net-pci,vlan=0,id=net0,mac=$MAC,bus=pci.0,addr=0x3 -net
tap -usbdevice tablet -vnc $VNC &


libvirtd tooling is more comprehensive, but in the end gets
invoked with

virsh start virtualmachinename

-dsr-

Back to linux.debian.user | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Running a FreeBSD guest Victor Sudakov <vas@sibptus.ru> - 2021-03-23 03:30 +0100
  Re: Running a FreeBSD guest Robbi Nespu <robbinespu@gmail.com> - 2021-03-23 05:10 +0100
    Re: Running a FreeBSD guest Victor Sudakov <vas@sibptus.ru> - 2021-03-23 11:00 +0100
      Re: Running a FreeBSD guest didier gaumet <didier.gaumet@gmail.com> - 2021-03-23 11:50 +0100
        Re: Running a FreeBSD guest Victor Sudakov <vas@sibptus.ru> - 2021-03-24 03:20 +0100
          Re: Running a FreeBSD guest didier gaumet <didier.gaumet@gmail.com> - 2021-03-24 10:00 +0100
            Re: Running a FreeBSD guest john doe <johndoe65534@mail.com> - 2021-03-24 10:30 +0100
      Re: Running a FreeBSD guest Dan Ritter <dsr@randomstring.org> - 2021-03-23 11:50 +0100
        Re: Running a FreeBSD guest Victor Sudakov <vas@sibptus.ru> - 2021-03-24 03:30 +0100
          Re: Running a FreeBSD guest Andrei POPESCU <andreimpopescu@gmail.com> - 2021-03-24 10:10 +0100
          Re: Running a FreeBSD guest Dan Ritter <dsr@randomstring.org> - 2021-03-24 12:00 +0100
  Re: Running a FreeBSD guest David Christensen <dpchrist@holgerdanske.com> - 2021-03-23 08:50 +0100
    Re: Running a FreeBSD guest <tomas@tuxteam.de> - 2021-03-23 09:50 +0100
  Re: Running a FreeBSD guest didier gaumet <didier.gaumet@gmail.com> - 2021-03-23 09:40 +0100
    Re: Running a FreeBSD guest Victor Sudakov <vas@sibptus.ru> - 2021-03-23 11:10 +0100
      Re: Running a FreeBSD guest didier gaumet <didier.gaumet@gmail.com> - 2021-03-23 11:30 +0100
        Re: Running a FreeBSD guest Victor Sudakov <vas@sibptus.ru> - 2021-03-23 11:50 +0100
      Re: Running a FreeBSD guest Liam O'Toole <liam.p.otoole@gmail.com> - 2021-03-23 23:00 +0100

csiph-web