Questions and Answers : Unix/Linux : How is virtualization support determined?
Message board moderation

To post messages, you must log in.

AuthorMessage
JasonDD

Send message
Joined: 7 Apr 10
Posts: 8
Credit: 665,435
RAC: 0
Message 42507 - Posted: 15 May 2020, 23:07:44 UTC

What is LHC@home looking for on a host to determine if its CPU supports virtualization? I'm running FreeBSD on an AMD Phenom II X6 with SVM enabled in the BIOS. I noticed in BOINC that the capabilities list is short and the features list is empty. SVM didn't show up anywhere until I modified the client code to recognize SVM and add it to the capabilities.

Fri May 15 15:43:41 2020 | | Processor: 6 amd64 AMD Phenom(tm) II X6 1035T ProcessorAMD Phenom(tm) II X6 1035T Processor [] [sse sse2 pni 3dnow 3dnowext mmx popcnt svm]
Fri May 15 15:43:41 2020 | | Processor features:
Fri May 15 15:43:41 2020 | | OS: FreeBSD: 11.3-RELEASE-p7
Fri May 15 15:43:41 2020 | | Memory: 31.94 GB physical, 0 bytes virtual
Fri May 15 15:43:41 2020 | | Disk: 1.67 TB total, 1.66 TB free
Fri May 15 15:43:41 2020 | | Local time is UTC -7 hours
Fri May 15 15:43:41 2020 | | VirtualBox version: 5.2.34r133883

After restarting and updating to the LHC project, the machine details still show:

Virtualization Virtualbox (5.2.34r133883) installed, CPU does not have hardware virtualization support

Does this condition prevent the machine from receiving any VirtualBox tasks?
I appreciate any help getting the machine to pick up VirtualBox tasks.
ID: 42507 · Report as offensive     Reply Quote
computezrmle
Volunteer moderator
Volunteer developer
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 15 Jun 08
Posts: 2410
Credit: 226,050,008
RAC: 126,780
Message 42510 - Posted: 16 May 2020, 8:06:46 UTC - in response to Message 42507.  

The reporting chain regarding CPU features looks like this:
CPU -> BIOS -> OS (FreeBSD in this case) -> BOINC client

LHC@home relies on this chain.
Your CPU is capable of AMD-V/SVM.
BOINC client (on linux) reads the CPU features from /proc/cpuinfo.
This might be different on FreeBSD.
See:
https://github.com/BOINC/boinc/blob/65d94b7bfcc015e6544cfde2e19fcfd81e45f806/client/hostinfo_unix.cpp


2 possible reasons why it doesn't work:
1. AMD-V/SVM might be switched OFF in your BIOS or disabled in your OS settings.
2. You run another hypervisor that fight against VirtualBox and locks the resources.
ID: 42510 · Report as offensive     Reply Quote
JasonDD

Send message
Joined: 7 Apr 10
Posts: 8
Credit: 665,435
RAC: 0
Message 42542 - Posted: 20 May 2020, 3:57:34 UTC - in response to Message 42510.  

Thanks for that, computezrmle. What I was looking for was to understand how the LHC app/website determines what to put on that line in the computer details webpage describing virtualization support. There must be some value or combination of values indicating level of virtualization support. I found this in samples/vboxwrapper/vbox_vboxmanage.cpp

       if (!strstr(aid.host_info.p_features, "vmx") && !strstr(aid.host_info.p_features, "svm")) {
            vboxlog_msg("Hardware acceleration CPU extensions not detected. Disabling VirtualBox hardware acceleration support.");
            disable_acceleration = true;
        }


The value 'svm' or 'vmx' must be in the 'Processor features' line as determined by BOINC. The processor features are, as you indicated, determined by the client/hostinfo_unix.cpp file. The problem is that the code in hostinfo_unix.cpp isn't sufficient to determine svm support for AMD CPUs, or at least my CPU under FreeBSD. I was able to patch the file somewhat so that I get 'svm' on the 'Processor features' line, and now LHC picks that up and reports virtualization is supported.
ID: 42542 · Report as offensive     Reply Quote
computezrmle
Volunteer moderator
Volunteer developer
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 15 Jun 08
Posts: 2410
Credit: 226,050,008
RAC: 126,780
Message 42543 - Posted: 20 May 2020, 4:53:35 UTC - in response to Message 42542.  

Is it your problem that you don't get vbox tasks although virtualization support shows up at your computer details page?
It may be due to the fact that the project doesn't offer a vbox app running on FreeBSD.
https://lhcathome.cern.ch/lhcathome/apps.php
ID: 42543 · Report as offensive     Reply Quote
JasonDD

Send message
Joined: 7 Apr 10
Posts: 8
Credit: 665,435
RAC: 0
Message 42545 - Posted: 20 May 2020, 14:38:39 UTC - in response to Message 42543.  
Last modified: 20 May 2020, 15:35:18 UTC

Yes, that's correct, I want to be able to run vbox tasks. Funny you say that because I just took a look at the list of applications this morning and noticed none of the vbox apps are for FreeBSD. Really, that shouldn't be a problem because these are VM images, right? As long as VirtualBox is available, I expected to receive tasks. Even if these were native apps, FreeBSD can run Linux apps, and I'm set up for that. World Community Grid sends me native Linux tasks and they get processed successfully.
ID: 42545 · Report as offensive     Reply Quote
computezrmle
Volunteer moderator
Volunteer developer
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 15 Jun 08
Posts: 2410
Credit: 226,050,008
RAC: 126,780
Message 42546 - Posted: 20 May 2020, 15:23:32 UTC - in response to Message 42545.  

You may send Laurence a PM and offer your computer as FreeBSD beta tester.
https://lhcathome.cern.ch/lhcathome/show_user.php?userid=419350
ID: 42546 · Report as offensive     Reply Quote
JasonDD

Send message
Joined: 7 Apr 10
Posts: 8
Credit: 665,435
RAC: 0
Message 42547 - Posted: 20 May 2020, 15:39:44 UTC - in response to Message 42546.  

Okay, thank-you for your help
ID: 42547 · Report as offensive     Reply Quote
Profile Laurence
Project administrator
Project developer

Send message
Joined: 20 Jun 14
Posts: 374
Credit: 238,712
RAC: 0
Message 42614 - Posted: 25 May 2020, 7:53:38 UTC - in response to Message 42507.  

From the host details page, is looks like virtualization is detected. I think the issue is how it reports the platform.

x86_64-pc-freebsd vs x86_64-pc-linux-gnu

I have added a new platform for the Theory app. Please let me know if that works for you.
ID: 42614 · Report as offensive     Reply Quote
JasonDD

Send message
Joined: 7 Apr 10
Posts: 8
Credit: 665,435
RAC: 0
Message 42626 - Posted: 27 May 2020, 9:20:16 UTC - in response to Message 42614.  

Laurence, I did get a bunch of tasks but they're all in a state of "Postponed: Communication with VM Hypervisor failed." I've fixed several things including permissions for /dev/vbox* files, DBus errors, and missing guest additions .iso file because the VBoxSvc.log file provided some hints. Now, after resolving those issues, there are no more hints - just ACCESSDENIED. Here is the latest output from VBoxSvc.log.

VirtualBox XPCOM Server 5.2.34 r133883 freebsd.amd64 (May 27 2020 01:12:11) release log
00:00:00.001068 main Log opened 2020-05-27T09:06:03.361527000Z
00:00:00.001072 main Build Type: release
00:00:00.001085 main OS Product: FreeBSD
00:00:00.001091 main OS Release: 11.3-RELEASE-p7
00:00:00.001097 main OS Version: FreeBSD 11.3-RELEASE-p7 #0 r325575+ca0f1a6ba25(HEAD): Tue Apr 21 20:46:20 UTC 2020 root@tnbuild01.tn.ixsystems.com:/freenas-releng/freenas/_BE/objs/freenas-releng/freenas/_BE/os/sys/FreeNAS.amd64
00:00:00.001117 main Host RAM: 32703MB (31.9GB) total, 13457MB (13.1GB) available
00:00:00.001124 main Executable: /usr/local/lib/virtualbox/VBoxSVC
00:00:00.001125 main Process ID: 42491
00:00:00.001127 main Package type: BSD_64BITS_GENERIC (OSE)
00:00:00.003343 main IPC socket path: /tmp/.vbox-boinc-ipc/ipcd
00:00:00.110301 nspr-2 VirtualBox: object creation starts
00:00:00.110496 nspr-2 Home directory: '/var/db/boinc/.config/VirtualBox'
00:00:01.134476 nspr-2 NAT: resolv.conf: nameserver xxx.xxx.xxx.xxx
00:00:01.134552 nspr-2 HostDnsMonitor::updateInfo
00:00:01.134581 nspr-2 HostDnsMonitor: old information
00:00:01.134592 nspr-2 no server entries
00:00:01.134603 nspr-2 no domain set
00:00:01.134613 nspr-2 no search string entries
00:00:01.134624 nspr-2 HostDnsMonitor: new information
00:00:01.134666 nspr-2 server 1: xxx.xxx.xxx.xxx
00:00:01.134677 nspr-2 domain: mydomain.net
00:00:01.134687 nspr-2 search string 1: mydomain.net
00:00:01.140476 nspr-2 VD: VDInit finished with VINF_SUCCESS
00:00:01.141253 nspr-2 VirtualBox: object created
00:00:06.147103 main VirtualBox: object deletion starts
00:00:06.147927 Watcher ERROR [COM]: aRC=E_ACCESSDENIED (0x80070005) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={The object is not ready}, preserve=false aResultDetail=0
00:00:06.148373 main VirtualBox: object deleted

ID: 42626 · Report as offensive     Reply Quote
JasonDD

Send message
Joined: 7 Apr 10
Posts: 8
Credit: 665,435
RAC: 0
Message 42633 - Posted: 27 May 2020, 18:34:03 UTC

Found this trace output in one of the VBox slots:

2020-05-25 09:29:42 (493):
Command: VBoxManage -q list hostinfo
Exit Code: 0
Output:
VBoxManage: error: Failed to initialize COM because the global settings directory '/.config/VirtualBox' is not accessible!


VBoxManage had been looking in the wrong path: it should be /var/db/boinc/.config/VirtualBox. I created a soft link to the root directory and that got rid of the VM Hypervisor communication issue. All tasks ran for about 15 s then exited with computation error. Output from that seems to indicate storage-related issues. That may just be due to the previous path issue and hopefully new tasks will work as expected.

00:00:02.321764 nspr-2 VirtualBox: object created
00:00:03.532599 nspr-3 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={Could not find a registered machine named 'boinc_c5b03ff1a8fdc086'}, preserve=false aResultDetail=0
00:00:03.539749 nspr-2 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={Could not find a registered machine named 'boinc_a9943c61fe3eef53'}, preserve=false aResultDetail=0
00:00:03.541719 nspr-2 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={Could not find a registered machine named 'boinc_d9bd85bc731c0ccd'}, preserve=false aResultDetail=0
00:00:03.553741 nspr-5 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={Could not find a registered machine named 'boinc_d6c331d15a368dea'}, preserve=false aResultDetail=0
00:00:03.638864 nspr-4 ERROR [COM]: aRC=NS_ERROR_INVALID_ARG (0x80070057) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk '/var/db/boinc/slots/10/vm_image.vdi' {c7cbbeeb-c984-467e-9b6e-0d2e670bed58} because a hard disk '/var/db/boinc/slots/11/vm_image.vdi' with UUID {c7cbbeeb-c984-467e-9b6e-0d2e670bed58} already exists}, preserve=false aResultDetail=0
00:00:03.666970 nspr-5 ERROR [COM]: aRC=NS_ERROR_INVALID_ARG (0x80070057) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk '/var/db/boinc/slots/12/vm_image.vdi' {c7cbbeeb-c984-467e-9b6e-0d2e670bed58} because a hard disk '/var/db/boinc/slots/11/vm_image.vdi' with UUID {c7cbbeeb-c984-467e-9b6e-0d2e670bed58} already exists}, preserve=false aResultDetail=0
00:00:03.694870 nspr-3 ERROR [COM]: aRC=NS_ERROR_INVALID_ARG (0x80070057) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk '/var/db/boinc/slots/13/vm_image.vdi' {c7cbbeeb-c984-467e-9b6e-0d2e670bed58} because a hard disk '/var/db/boinc/slots/11/vm_image.vdi' with UUID {c7cbbeeb-c984-467e-9b6e-0d2e670bed58} already exists}, preserve=false aResultDetail=0
00:00:03.708839 nspr-4 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={Could not find a registered machine named 'boinc_dc49c621d1a47cc9'}, preserve=false aResultDetail=0
00:00:03.732973 nspr-3 Saving settings file "/var/db/boinc/slots/12/boinc_d6c331d15a368dea/boinc_d6c331d15a368dea.vbox" with version "1.16-freebsd"
00:00:03.846398 nspr-5 Saving settings file "/.config/VirtualBox/VirtualBox.xml" with version "1.12-freebsd"
00:00:08.473439 nspr-6 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={85cd948e-a71f-4289-281e-0ca7ad48cd89} aComponent={SessionMachine} aText={No storage device attached to device slot 0 on port 0 of controller 'Hard Disk Controller'}, preserve=false aResultDetail=0
00:00:08.480386 nspr-6 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={85cd948e-a71f-4289-281e-0ca7ad48cd89} aComponent={SessionMachine} aText={No storage device attached to device slot 0 on port 0 of controller 'Hard Disk Controller'}, preserve=false aResultDetail=0
00:00:08.482060 nspr-3 Saving settings file "/var/db/boinc/slots/12/boinc_d6c331d15a368dea/boinc_d6c331d15a368dea.vbox" with version "1.16-freebsd"
00:00:11.425915 nspr-4 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={85cd948e-a71f-4289-281e-0ca7ad48cd89} aComponent={SessionMachine} aText={This machine does not have any snapshots}, preserve=false aResultDetail=0
00:00:11.427093 nspr-6 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={85cd948e-a71f-4289-281e-0ca7ad48cd89} aComponent={SessionMachine} aText={This machine does not have any snapshots}, preserve=false aResultDetail=0
00:00:11.445746 nspr-6 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={85cd948e-a71f-4289-281e-0ca7ad48cd89} aComponent={SessionMachine} aText={This machine does not have any snapshots}, preserve=false aResultDetail=0
00:00:12.275916 nspr-6 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={85cd948e-a71f-4289-281e-0ca7ad48cd89} aComponent={SessionMachine} aText={This machine does not have any snapshots}, preserve=false aResultDetail=0
00:00:12.276070 nspr-10 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={85cd948e-a71f-4289-281e-0ca7ad48cd89} aComponent={SessionMachine} aText={This machine does not have any snapshots}, preserve=false aResultDetail=0
00:00:12.462268 nspr-2 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={85cd948e-a71f-4289-281e-0ca7ad48cd89} aComponent={SessionMachine} aText={This machine does not have any snapshots}, preserve=false aResultDetail=0
00:00:12.480533 nspr-6 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={85cd948e-a71f-4289-281e-0ca7ad48cd89} aComponent={SessionMachine} aText={This machine does not have any snapshots}, preserve=false aResultDetail=0
00:00:12.486634 nspr-2 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={85cd948e-a71f-4289-281e-0ca7ad48cd89} aComponent={SessionMachine} aText={This machine does not have any snapshots}, preserve=false aResultDetail=0
00:00:14.413734 nspr-12 ERROR [COM]: aRC=E_ACCESSDENIED (0x80070005) aIID={4afe423b-43e0-e9d0-82e8-ceb307940dda} aComponent={MediumWrap} aText={The object is not ready}, preserve=false aResultDetail=0
00:00:14.414254 nspr-12 ERROR [COM]: aRC=E_ACCESSDENIED (0x80070005) aIID={4afe423b-43e0-e9d0-82e8-ceb307940dda} aComponent={MediumWrap} aText={The object is not ready}, preserve=false aResultDetail=0
00:00:23.567057 main VirtualBox: object deletion starts
00:00:23.847278 Watcher ERROR [COM]: aRC=E_ACCESSDENIED (0x80070005) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={The object is not ready}, preserve=false aResultDetail=0
00:00:23.847887 main VirtualBox: object deleted
ID: 42633 · Report as offensive     Reply Quote
computezrmle
Volunteer moderator
Volunteer developer
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 15 Jun 08
Posts: 2410
Credit: 226,050,008
RAC: 126,780
Message 42635 - Posted: 27 May 2020, 18:47:58 UTC

You may at first sort out problems that are caused by the interface FreeBSD <-> VirtualBox.
Hence you may create your own VM and run linux as guest.
Check if internet access is possible from that guest.

It makes no sense to run a VM from LHC as long as basic problems are not sorted out.
ID: 42635 · Report as offensive     Reply Quote
JasonDD

Send message
Joined: 7 Apr 10
Posts: 8
Credit: 665,435
RAC: 0
Message 42653 - Posted: 28 May 2020, 13:55:02 UTC - in response to Message 42635.  

You're right, and I think it's ready now. There was a kernel module (vmm.ko) loaded for the Bhyve hypervisor, which was causing the VirtualBox VMs to abort. I then tested with a local Linux VM and verified Internet connectivity from within it.
ID: 42653 · Report as offensive     Reply Quote
computezrmle
Volunteer moderator
Volunteer developer
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 15 Jun 08
Posts: 2410
Credit: 226,050,008
RAC: 126,780
Message 42658 - Posted: 29 May 2020, 12:10:57 UTC

Looks like Theory vbox runs fine.
Congrats!

Just one minor hint.
Your logfiles show that you throttled your CPU usage:
2020-05-28 23:50:02 (66501): Setting CPU throttle for VM. (75%)

This works fine if you run native apps.
If you run vbox apps a couple of processes rely on each other.
In addition longrunners might hit the runtime limit.

To avoid timeout problems CPU throttle should be set to 100%.
ID: 42658 · Report as offensive     Reply Quote
JasonDD

Send message
Joined: 7 Apr 10
Posts: 8
Credit: 665,435
RAC: 0
Message 42659 - Posted: 29 May 2020, 13:30:51 UTC - in response to Message 42658.  

Yes, success! Thanks to you and Laurence for the help.
ID: 42659 · Report as offensive     Reply Quote
boinc127

Send message
Joined: 5 Feb 12
Posts: 19
Credit: 700,079
RAC: 0
Message 43222 - Posted: 16 Aug 2020, 19:19:03 UTC

Thanks to your hints I was able to patch the boinc-client to show processor features and now I can run the Theory app on FreeBSD as well. But I noticed the wrapper is a Linux app? I just wanted to clarify that there isn't a native FreeBSD wrapper. I understand it's pretty moot anyway, since the VM is a Linux OS.
ID: 43222 · Report as offensive     Reply Quote

Questions and Answers : Unix/Linux : How is virtualization support determined?


©2024 CERN