Apple Hypervisor is completely broken on MacOS Big Sur beta 11.0.1 - c

I am trying to make a basic command-line tool that makes a VM and runs something using Apple Hypervisor.
When I try to run hv_vm_create(HV_VM_DEFAULT) it gives me an error code -85377023.
I tried enforcing App Sandbox and setting the entitlement accordingly for the Big Sur compile target, and now I am getting this output in the console:
Killed
From what I understand from this, this is AMFI killing my process. Is this a bug or my problem?
When I decided to go down the rabbit hole, I found that in the MacOS Big Sur 11.0.1 beta release notes, they deprecated hv_vm_run(_:), while the API documentation says that this function is in beta.
I didn't go as far as disabling AMFI with a kernel flag, but I am almost certain that this is not expected behavior. And that, no matter what, hv_vm_run(_:) can never be deprecated OR be in beta. I am sure that this function existed well before Big Sur.
If anyone can help me with this or just give a response, please do. Do not keep me in darkness as I don't want to waste time on something which is potentially broken.
Thank you.
P.S: I know that there is already a thread in the Apple Developer forums, I am the one who posted it. Though, no one is answering there because their community is not even close to being as large as Stack Overflow.

This error code you're seeing is just a poor UX on the macOS side: what it's really trying to communicate is that the com.apple.security.hypervisor entitlement is missing.
If you're using Xcode, you can add it like that:
Press ⌘N and create a new Property List file.
Add a new property with the key com.apple.security.hypervisor and a boolean value set to YES.
Go to Project → Target → Build Settings → Signing → Code Signing Entitlements and make sure it uses your newly created entitlements file.
Alternatively, you can use command line:
codesign -s - --entitlements app.entitlements --force path/to/your/binary
Where app.entitlements contents is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.hypervisor</key>
<true/>
</dict>
</plist>
The other way you to solve this is to simply set the Deployment Target to 10.13 in the Xcode's settings (props to Alexander Pinske):
The reason this works is most likely due to backwards-compatibility, so bear in mind that this might change in the future macOS releases, or, perhaps, on newly introduced platforms like Apple Silicon.

Related

Replacement for pa_alsa_linux.h and pa_jack.h with pipewire

I'm running Pop_OS 22.04 (which has pipewire audio) and audacity is hanging on launch (unless it is launch with sudo, which seems quite odd).
To try and debug the system, I'm trying to build audacity from github sources.
In the initial configuration phase of the build, I get the following messages
-- Fixing up ZLib mess...
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- Looking for pa_jack.h
-- Looking for pa_jack.h - not found
-- Looking for pa_linux_alsa.h
-- Looking for pa_linux_alsa.h - not found
So, here is the thing I am confused about. I thought that pipewire was API compatible with pulse-audio. So shouldn't there be a version of the pa_*.h files to use with pipewire? If so, which Debian package do I need to install to get them?
The pa_ stands for PortAudio, not pulse-audio. The portaudio19-dev package had the required header files.

“choregraphe-suite-2.8.6.23-mac64-setup” cannot be opened because the developer cannot be verified

I am trying to install Choregraphe Suite on my macOS Catalina (v10.15.7) from the softbankrobotics website but I get this message:
Website link: https://developer.softbankrobotics.com/nao6/naoqi-developer-guide/choregraphe-suite/choregraphe-suite-installation-guide#desktop-installation
I don't know what I'm missing in order to run the installation on my laptop. I would appreciate it if anyone can help me on this.
Update: I left clicked it and it opened in command line. I went into the choregraphe-folder/bin/naoqi-bin and when I executed the file I got this:
Last login: Sat Nov 7 09:05:34 on ttys000
/Users/name/EEP_work/choregraphe-suite-2.8.6.23-mac64/bin/naoqi-bin ; exit;
name#Mahlas-MBP ~ % /Users/name/EEP_work/choregraphe-suite-2.8.6.23-mac64/bin/naoqi-bin ; exit;
dyld: Library not loaded: #rpath/QtCore.framework/Versions/5/QtCore
Referenced from: /Users/name/EEP_work/choregraphe-suite-2.8.6.23-mac64/bin/naoqi-bin
Reason: image not found
zsh: abort
[Process completed]
Thanks :)
You can go to the system settings > security & privacy and explicitly allow the opening of the installer (screenshot attached).
allow opening of installer
It will then bring up a second dialog:
"macOS cannot verify the developer of “choregraphe-suite-2.8.6.23-mac64-setup”. Are you sure you want to open it?
By opening this app, you will be overriding system security which can expose your computer and personal information to malware that may harm your Mac or compromise your privacy."
You can then click on "Open", but for my Mac (10.15.7) the installer crashes directly afterwards and I cannot install anything.
allow installation
It seems impossible to install Choregraphe on a recent Mac OS X. Help would be much appreciated.
'Allow install from internet' is the step you have to go over for all 3rd party apps(always happening) for macs. But still 'choregraphe' setup file didn't worked.
I hope my solution helps, i searched a lot too :)
install not setup file, try binaries oneenter image description here, and unzip. Open file you will see 'choregraphe' unix executable file, i clicked that file and app worked, best
P.s. i am not expert or anything that is only way i was able to make it work for my MacOs 10.15.7 (Catalina)

In OpenBSD how to upgrade individual system files like (grep, rcs, rlog ) to latest version?

I am attempting to run foswiki on OpenBSD. Things are installed and i am able to open "/bin/Configure" page of foswiki configuration screen. but the page reports few errors, complaining that following files are either not found or outdated and new versions are required.
The Files are : grep, rcs, ci, co,rlog, rcsdiff
I tried commands like "pkg_add -Uu" to upgrade packages installed, but it reports all packages are uptodate.
I also tried "pkg_add rcs" "pkg_add grep" etc but non works.
So my basic question is how to I update above files to their latest version required by foswiki.
Regards
While I’m not familiar with Foswiki, my first thought is your web server is chrooted, as this is the default on OpenBSD, and, as a result, Foswiki cannot find the files it needs. You can copy the files Foswiki needs into the chroot or run the web server without chroot, which is bad from a security perspective.
all programs mentioned are part of a base openbsd install and the above answer is correct. the openbsd documentation on chrooted apache has more info.
if you don't have to stick with foswiki you can try dokuwiki instead which has package support on openbsd and installs easily in very much the same way you tried already:
sudo pkg_add -U dokuwiki
hope the process is pretty much self-descriptive. in addition, the manpage for pkg_add is a good thing to read. good luck!

"Your GStreamer installation is missing a plug-in." (GstURIDecodeBin)

I have: gstreamer-sdk, gstreamer-ffmpeg, gstreamer-plugins-good, bad, and ugly. I googled everywhere for this error and have found nothing relevant. I'm going a little nuts trying to figure out this error:
Error received from element decodebin20: Your GStreamer installation is missing a plug-in.
Debugging information: gstdecodebin2.c(3576): gst_decode_bin_expose (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20:
no suitable plugins found
It throws when I run my gstreamer program. Any ideas on why?
You may not be missing any plugins at all.
This error can be a result of just an unlinked pipeline.
Playbin2(decodebin2) got some changes that made it unable to automatically link up some pipelines that formally worked, for example transcoding a decoder to an encoder. In my case, explicitly adding the ffdec_h264 that it used to add automatically fixed it.
Relying on the Playbin2 can be very frustrating when it does not work. Using the setup below, you can create a .png diagram of the pipeline in various phases of construction. It's very helpful in finding why it isn't linking up.
export GST_DEBUG_DUMP_DOT_DIR=~/gstdump
for f in $GST_DEBUG_DUMP_DOT_DIR/*.dot ; do dot -T png $f >$f.png; done
This tool also lets you learn from it how to link up pipelines, and replace them with explicit ones that are easier to debug and less likely to break.
In Fedora, I resolved this issue removing gstreamer1-vaapi.x86_64:
sudo yum remove gstreamer1-vaapi.x86_64
uridecodebin is part of the "base" plugin set, so make sure you have gstreamer-plugins-base.
Another thing to look into is your LD_LIBRARY_PATH and GST_PLUGIN_PATH. If they point to a different GStreamer installation, it could cause problems like this. Also, if you didn't install GStreamer with a package manager, you may need to set your LD_LIBRARY_PATH to point to it (or better yet, install it with a package manager).
Pleas try to use gst-inspect command to find out if environment is correctly setup.
use gst-launch -v playbin2 uri = "your_uri_here" to find more information to trace this issue.

~/Library/LaunchAgents plist runs manually but not automatically

I am starting to work with launchd and want to set up a plist file such that whenever I insert an SD card into my Mac mini server (with Snow Leopard Server), I want a shell script to run (which should copy all the jpg files, rename them etc).
So, I created a plist file in the ~/Library/LaunchAgents (see below for its contents - it should be looking for changes to /Volumes) and I created a shell script which says "beep" - later it will do something more useful.
The plist file is registered with launchctl, and when I run it (launchctl start com.peters.runwhenSDmount), the computer says beep whenever a memory card is plugged in, and stays silent when there is no memory card. So, apparantly the plist does call the shell script, which subsequently checks if the specific SD card is there. I assume this also proves that there is no problem with permissions for the SD card.
But, it doesnt seem to run by itself??? Any idea why??
plist file: ~/Library/LaunchAgents/com.peters.runwhenSDmount.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" \
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<dict>
<key>Label</key>
<string>com.peters.runwhenSDmount</string>
<key>LowPriorityIO</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/Users/peter/Library/Scripts/runwhenSDmount</string>
</array>
<key>ThrottleInterval</key>
<integer>10</integer>
<key>WatchPaths</key>
<array>
<string>/Volumes</string>
</array>
</dict>
</plist>
shell script: ~/Library/Scripts/runwhenSDmount
#!/bin/bash
if [ -d "/Volumes/NIKON D40X" ]; then
say beep
fi
After you create a new plist in your ~/Library/LaunchAgents folder, you have to tell the launchd application about it. The two basic ways to do that are:
Logout then log back in. - Every time you log in, launchd will scan the contents of your ~/Library/LaunchAgents folder and add any plist it finds there.
Load the plist from a terminal command line with "launchctl". The syntax of the command is:
launchctl load {Path-to-plist}
The launchctl command can also be used to stop launchd from using a plist. To do that, use:
launchctl unload {Path-to-plist}
The launchctl command is very useful when developing plists since it makes unloading/loading them between changes quick and easy. Once you have a plist working the way you like, the automatic login launchd loading can take over.
I just had a similar problem with automatically launching the services in ~/Library/LaunchAgents, but in my case NONE of the *.plist defined services got started.
The problem was obviously connected to the directory ~/Library/LaunchAgents and not the plist files itself. The solution was to reset the file permissions.
chmod 700 ~/Library/LaunchAgents.
Update for homebrew users: (2015-02-23)
Yesterday I just found LaunchRocket which is a Mac PreferencePane for managing services with launchd. It is homebrew aware ands adds a nice UI for managing launchd homebrew services.
This may not help you with incorrect user permissions but it is open source so you can fork the project and add the permission check as a feature.
Two tools that help with the creation and management of launchd items are:
LaunchControl - "LaunchControl is a fully-featured launchd(8) frontend allowing you to create, manage and debug system- and user services on your Mac."
Lingon - "An easy to use yet powerful utility that runs things automatically on your Mac"
As a note: Brett Terpstra (who does a bunch of great Mac work on things like nvAlt) recently commented in his post "Triggering tasks remotely with notifyutil and launchd" that he used to use Lingon, but has been using LaunchControl more recently. Either of them is worth looking into.

Resources