Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

0 votes
0 answers
90 views
Abort trap when trying to run nested bhyve from FreeBSD kvm guest
I have a FreeBSD VM, which is running over Linux KVM, in which when I try to run a bhyve virtual machine I get the following error: ``` vm exit[0] reason SVM rip 0x000000000f49eac0 inst_length 2 exitcode 0x7b exitinfo1 0x511021d exitinfo2 0xf49eac2 Abort trap ``` I am running KVM with the command: `...
I have a FreeBSD VM, which is running over Linux KVM, in which when I try to run a bhyve virtual machine I get the following error:
vm exit
	reason		SVM
	rip		0x000000000f49eac0
	inst_length	2
	exitcode	0x7b
	exitinfo1	0x511021d
	exitinfo2	0xf49eac2
Abort trap
I am running KVM with the command:
/usr/sbin/bhyve -A -D -H -P -S -u -w -c 1 -m 250m -s 0,amd_hostbridge \
      -s 5,virtio-blk,FreeBSD-14.0-RELEASE-amd64-bootonly.iso \
      -s 7,virtio-blk,guest.img \
      -s 29,virtio-rnd -s 21,virtio-net,tap0 -s 31,lpc \
      -l com1,stdio \
      -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd test
The FreeBSD VM is a fresh install of FreeBSD-14.1-RELEASE-amd64-memstick.img, which is provisioned with the following script
pkg install -y bhyve-firmware
truncate -s 16G guest.img
fetch https://download.freebsd.org/releases/ISO-IMAGES/14.0/FreeBSD-14.0-RELEASE-amd64-bootonly.iso 
kldload vmm
And have already proved that the Linux KVM host is providing nested virtualization with a Linux guest which ran another KVM virtual machine. Also I here the virt-manager xml of the FreeBSD VM:
freebsd
  88888888-8888-8888-8888-888888888888
  
    
      
    
  
  1048576
  1048576
  1
  
    hvm
  
  
    
    
    
  
  
  
    
    
    
  
  destroy
  restart
  destroy
  
    
    
  
  
    /usr/bin/qemu-system-x86_64
Delfin (150 rep)
Oct 14, 2024, 04:08 PM • Last activity: Oct 14, 2024, 04:21 PM
0 votes
1 answers
463 views
Tryng to enable the passhtru of one Nvidia gpu to a Bhyve Linux vm on FreeBSD 14.0
For some years it worked,but now,maybe due to the recent changes added on the FreeBSD 13 and 14 code,it does not work anymore : I'm talking about the ability to passthru one Nvidia GpU from the host os (FreeBSD 14.0 in this case) to any Linux vm. The same procedure that worked until "yesterday" it d...
For some years it worked,but now,maybe due to the recent changes added on the FreeBSD 13 and 14 code,it does not work anymore : I'm talking about the ability to passthru one Nvidia GpU from the host os (FreeBSD 14.0 in this case) to any Linux vm. The same procedure that worked until "yesterday" it does not work anymore (for me). The developer does not reply to my message anymore. I would like to be sure that is true that it is bugged,as it seems,and not that I'm making some mistake. So,I will explain what I do to enable this functionality. I hope that someone wants to also try or that he tries a different procedure that works. The most important thing is that we will be able to enable the function. So,time ago the developer gave me 3 scripts to run in sequence. They are the following : a) setup_git_140.sh git clone https://github.com/beckhoff/freebsd-src /usr/corvin-src-140 b) build_branch_140.sh
#!/bin/sh
    
    usage() {
    	cat >&2  []
    	Checkouts to  and builds it with 
     (see build.sh for more information).
    EOF
    	exit 1
    }
    
    set -e
    set -u
    
    readonly script_path="$(cd "$(dirname "${0}")" && pwd)"
    readonly branch="${1?Missing $(usage)}"
    shift
    echo $branch
    
    cd /usr/corvin-src-140
    git fetch --all --prune
    git checkout -f "${branch}"
    
    ${script_path}/build_140.sh "$@"
c) build_build_140.sh
#!/bin/sh
    
    usage() {
    	cat >&2  "${cmd_redirect}" 2>&1
    	fi
    
    	# build module
    	make > "${cmd_redirect}" 2>&1
    
    	# install module
    	make install > "${cmd_redirect}"
    }
    
    build() {
    	build_module "${src_dir}/include"
    	build_module "${src_dir}/lib/libvmmapi"
    	build_module "${src_dir}/sys/modules/vmm"
    
    	# build kernel
    	if test "${with_kernel}" = "true"; then
    		cd "${src_dir}"
    		local kern_opts
    		kern_opts="-j$(sysctl -n hw.ncpu)"
    		if test "${with_bhf}" = "true"; then
    			kern_opts="${kern_opts} 
    KERNCONF=BHF"
    		fi
    		if ! test "${clean}" = "true"; then
    			kern_opts="${kern_opts} 
    NO_CLEAN=YES"
    		fi
    		make kernel ${kern_opts} > "${cmd_redirect}" 2>&1
    	fi
    
    	build_module "${src_dir}/usr.sbin/bhyve"
    	build_module "${src_dir}/usr.sbin/bhyvectl"
    	build_module "${src_dir}/usr.sbin/bhyveload"
    
    	if test "${with_reboot}" = "true"; then
    		reboot
    	fi
    }
    
    set -e
    set -u
    
    while test $# -gt 0; do
    	case "${1-}" in
    		--clean)
    			clean="true"
    			shift
    			;;
    		--reboot)
    			with_reboot="true"
    			shift
    			;;
    		--src-dir=*)
    			src_dir="${1#*=}"
    			shift
    			;;
    		--verbose)
    			cmd_redirect="/dev/stdout"
    			shift
    			;;
    		--without-bhf)
    			with_bhf="false"
    			shift
    			;;
    		--without-kernel)
    			with_kernel="false"
    			shift
    			;;
    		*)
    			usage
    			;;
    	esac
    done
    
    readonly clean="${clean-"false"}"
    readonly cmd_redirect="${cmd_redirect-"/dev/null"}"
    readonly src_dir="${src_dir-"/usr/corvin-src-140"}"
    echo $src_dir
    readonly with_bhf="${with_bhf-"true"}"
    readonly with_kernel="${with_kernel-"true"}"
    readonly with_reboot="${with_reboot-"false"}"
    
    build
Here we go. This is what I do to start the compilation that should produce the working bhyve system files that will give to use the passthru of one nvidia gpu on FreeBSD 14.0 : a) ./setup_git_140.sh b) ./build_branch_140.sh origin/phab/corvink/14.0/nvidia-wip --without-bhf --verbose ok. It compiled the code without giving errors,until a certain point,when it happens what you see below. I want to understand if the code is bugged. Please help me : /usr/corvin-src-140/usr.sbin/bhyve/pci_passthru.c:1174:21: error: use of undeclared identifier 'ctx' passthru_cfgwrite(ctx, vcpu, pi, offset - 0x88000, size, value); ^ /usr/corvin-src-140/usr.sbin/bhyve/pci_passthru.c:1174:26: error: use of undeclared identifier 'vcpu' passthru_cfgwrite(ctx, vcpu, pi, offset - 0x88000, size, value); ^ /usr/corvin-src-140/usr.sbin/bhyve/pci_passthru.c:1209:20: error: use of undeclared identifier 'ctx' passthru_cfgread(ctx, vcpu, pi, offset - 0x88000, size, (uint32_t *)&val); ^ /usr/corvin-src-140/usr.sbin/bhyve/pci_passthru.c:1209:25: error: use of undeclared identifier 'vcpu' passthru_cfgread(ctx, vcpu, pi, offset - 0x88000, size, (uint32_t *)&val); ^ /usr/corvin-src-140/usr.sbin/bhyve/pci_passthru.c:1302:29: error: use of undeclared identifier 'ctx' if (vm_unmap_pptdev_mmio(ctx, sc- >psc_sel.pc_bus, ^ /usr/corvin-src-140/usr.sbin/bhyve/pci_passthru.c:1309:27: error: use of undeclared identifier 'ctx' if (vm_map_pptdev_mmio(ctx, sc- >psc_sel.pc_bus, ^ /usr/corvin-src-140/usr.sbin/bhyve/pci_passthru.c:1327:29: error: use of undeclared identifier 'ctx' if (vm_unmap_pptdev_mmio(ctx, sc- >psc_sel.pc_bus, ^ /usr/corvin-src-140/usr.sbin/bhyve/pci_passthru.c:1334:27: error: use of undeclared identifier 'ctx' if (vm_map_pptdev_mmio(ctx, sc- >psc_sel.pc_bus, ^ 8 errors generated. *** Error code 1 The passthru of one nvidia card inside a linux vm WILL NOT work if you don't do what I have explained. The FreeBSD wiki does not talk about the nvidia gpu,but only about network interfaces. If you want to help me,if you have one nvidia card, if you want to pass it through inside a Linux VM,you SHOULD repeat the steps that I have explained. And tell me if you are able to compile the code successfully. Thanks
Marietto (579 rep)
Feb 23, 2024, 05:05 PM • Last activity: Feb 26, 2024, 06:46 PM
0 votes
0 answers
330 views
How to backup VM from bhyve and migrate it to KVM?
I am stuck here and can not find information about migrating Windows and Linux/Unix vm's to KVM. Doing it with zfs is inefficient, because it will transfer the whole disk space, which can be more than 200GB. Making a copy of the directories in Linux/Unix machines kind of worked, but I don't think th...
I am stuck here and can not find information about migrating Windows and Linux/Unix vm's to KVM. Doing it with zfs is inefficient, because it will transfer the whole disk space, which can be more than 200GB. Making a copy of the directories in Linux/Unix machines kind of worked, but I don't think that's the right way. cp -R /etc cp -R /home/user And send those copies to the KVM machine. For the Linux part was basically that. I needed mainly installed services and their configs. If there is a way to copy the entire VM and spin it up on KVM good, I am open. Creating a backup of Windows Server does not work also, because it creates vhdx files and converting them to qcow2 seems to break them, or I just don't do it right. I use the Backup service and add the whole system backup zip to a network share. Basically that's it and I am stuck how it can but used to spin up new Windows VM on KVM. Can someone give me guidance here?
Baequiraheal (11 rep)
Dec 14, 2022, 11:59 AM • Last activity: Dec 14, 2022, 12:58 PM
1 votes
1 answers
923 views
How to use vm-bhyve image create?
As per the [Documentation](https://www.freebsd.org/cgi/man.cgi?query=vm&sektion=8&manpath=freebsd-release-ports) it will create a new image from the named virtual machine you pass. It should look like this: vm image create -u VMNAME After executing that command as `root` I get this error: vm: ERROR:...
As per the [Documentation](https://www.freebsd.org/cgi/man.cgi?query=vm&sektion=8&manpath=freebsd-release-ports) it will create a new image from the named virtual machine you pass. It should look like this: vm image create -u VMNAME After executing that command as root I get this error: vm: ERROR: failed to create snapshot of source dataset root/vm/VMNAME@gdee65d I found no information or similar problem. Update: The goal here is to create an image/iso file of a running vm and migrate it to a cloud, which accepts only custom iso files.
Baequiraheal (11 rep)
Sep 27, 2022, 07:27 PM • Last activity: Oct 1, 2022, 06:05 AM
0 votes
0 answers
339 views
How to start xorg in Arch Linux virtual machine running top of FreeBSD's bhyve?
I'm trying to start KDE Plasma and SDDM with virtualized Arch Linux. The host is FreeBSD running bhyve. Bootloader is UEFI. Looking at the virtual display with VNC connection with remmina (VNC viewer) ends with systemd log saying: ``` Reached target Graphical Interface. ``` but xorg doesn't launch a...
I'm trying to start KDE Plasma and SDDM with virtualized Arch Linux. The host is FreeBSD running bhyve. Bootloader is UEFI. Looking at the virtual display with VNC connection with remmina (VNC viewer) ends with systemd log saying:
Reached target Graphical Interface.
but xorg doesn't launch and switch to graphical mode. Am I missing a driver or configuration or some bhyve-specific guest tools or kernel boot parameter? I've also installed tigervnc and when connecting to it with remmina KDE works just fine, so the virtual "physical" display seems to be the problem. /var/log/Xorg.0.log:
[   124.544] (EE) open /dev/dri/card0: No such file or directory
[   124.544] (WW) Falling back to old probe method for modesetting
[   124.544] (EE) open /dev/dri/card0: No such file or directory
lspci -vvvvvvvv:
...

00:1d.0 VGA compatible controller: Device fb5d:40fb (prog-if 00 [VGA controller])
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- 
/etc/X11/xorg.conf:
Section "Device"
        Identifier "fb0"
        Driver     "fbdev"
        # PCI 00:1d.0, 0x1d = 29
        BusID      "PCI:0:29:0"
EndSection
$ pacman -Qsq xf86-video
xf86-video-fbdev
xf86-video-qxl
xf86-video-vesa
raspi (1466 rep)
Aug 3, 2022, 12:23 AM
Showing page 1 of 5 total questions