4nd3r / mkosi-intune Goto Github PK
View Code? Open in Web Editor NEWIntune for Linux feat. systemd-nspawn
Home Page: https://learn.microsoft.com/en-us/mem/intune/user-help/enroll-device-linux
Intune for Linux feat. systemd-nspawn
Home Page: https://learn.microsoft.com/en-us/mem/intune/user-help/enroll-device-linux
I'm having issues with building mkosi-intune
.
_UID="1000" _USER="sayan" _GID="1000" _GROUP="sayan" _HOME="/home/sayan" mkosi --profile x --image-id corphost -f
‣ Removing output files…
‣ Building corphost image
‣ Copying in package manager file trees…
‣ Copying in skeleton file trees…
‣ Installing Ubuntu
Hit:1 https://packages.microsoft.com/repos/edge stable InRelease
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Hit:3 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease
Get:4 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Err:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Err:4 http://archive.ubuntu.com/ubuntu jammy InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Get:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Err:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Reading package lists... Done
W: GPG error: http://security.ubuntu.com/ubuntu jammy-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://security.ubuntu.com/ubuntu jammy-security InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.ubuntu.com/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.ubuntu.com/ubuntu jammy-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
‣ "env APT_CONFIG=/home/sayan/.cache/mkosi-workspacebv7dp0ju/apt.conf DEBIAN_FRONTEND=noninteractive DEBCONF_INTERACTIVE_SEEN=true INITRD=No apt-get -o APT::Architecture=amd64 -o APT::Architectures=amd64 -o APT::Install-Recommends=false -o APT::Immediate-Configure=off -o APT::Get::Assume-Yes=true -o APT::Get::AutomaticRemove=true -o APT::Get::Allow-Change-Held-Packages=true -o APT::Get::Allow-Remove-Essential=true -o APT::Sandbox::User=root -o Dir::Cache=/home/sayan/2-areas/code/work/mkosi-intune/mkosi.cache/cache/apt -o Dir::State=/home/sayan/2-areas/code/work/mkosi-intune/mkosi.cache/lib/apt -o Dir::State::Status=/home/sayan/.cache/mkosi-workspacebv7dp0ju/root/var/lib/dpkg/status -o Dir::Log=/home/sayan/.cache/mkosi-workspacebv7dp0ju -o Dir::Bin::DPkg=/usr/bin/dpkg -o Debug::NoLocking=true -o DPkg::Options::=--root=/home/sayan/.cache/mkosi-workspacebv7dp0ju/root -o DPkg::Options::=--force-unsafe-io -o DPkg::Options::=--force-architecture -o DPkg::Options::=--force-depends -o DPkg::Options::=--no-debsig -o DPkg::Use-Pty=false -o DPkg::Install::Recursive::Minimum=1000 -o pkgCacheGen::ForceEssential=, update" returned non-zero exit code 100.
To fix this I had to import the Ubuntu keys into the mkosi.skeleton
. I'm wondering if I missed something during installation or this is a known issue.
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 871920D1991BC93C
mkdir -p mkosi.skeleton/usr/share/keyrings
gpg --export 871920D1991BC93C > mkosi.skeleton/usr/share/keyrings/ubuntu-archive-keyring.gpg
I am trying to set this up on arch, it looks like maybe this only works with debian based distros?
I: Base system installed successfully.
‣ Copying in skeleton file trees…
sh: line 1: /usr/bin/apt-get: No such file or directory
‣ Error: "/usr/bin/apt-get update --assume-yes" returned non-zero exit code 127.
Trying this again after a while. Not sure which error is relevant here. Note, I used the command below, but I also tried simply sudo make
and got the same error
_HOST=corp$(hostname) _UID=$(id -u) _USER=${USER} _GID=$(id -g) _GROUP=$(id -gn) _HOME=${HOME} sudo -E make build
W: Unable to read /etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory)
W: No sandbox user '_apt' on the system, can not drop privileges
‣ Unmounting API VFS…
‣ Unmounting Package Cache
‣ Mounting Package Cache
‣ Running prepare script…
Failed to map ids for bind mount /home/rayben/source/mkosi-intune/mkosi.workspace/zzazsk81/root/root/src: Device or resource busy
‣ Error: Workspace command /root/prepare final returned non-zero exit code 1.
make: *** [Makefile:12: build] Error 1
sudo mkosi build
fails with:
Created symlink /etc/systemd/user/default.target.wants/intune-agent.service → /usr/lib/systemd/user/intune-agent.service.
Running in chroot, ignoring command 'list-units'
Running in chroot, ignoring command 'list-units'
Processing triggers for dictionaries-common (1.28.14) ...
Processing triggers for libc-bin (2.35-0ubuntu3) ...
‣ Unmounting Package Cache
‣ Setting root password
‣ Mounting Package Cache
‣ Running postinstall script…
‣ Unmounting Package Cache
‣ Recording packages in manifest…
‣ Error: dpkg-query not found in PATH.
‣ (Unmounting image)
I tried adding proper PATH to environment:
+# Arch Linux doesn't have /usr/sbin in PATH, let's reset to Ubuntu's default value
Environment=
INTUNE_HOSTNAME=intune-test-jammy
INTUNE_UID=1000
INTUNE_GID=users
INTUNE_USER=user
INTUNE_HOME=/home/user
+ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Packages=
ca-certificates
curl
... but this made no difference.
Switched to Debian bookworm, if I specifically need SID let me know. I know this is best guess support as it's not your full time job :P so I appreciate any help.
I tried building mkosi-intune in both Ubuntu and Debian with out of box (apt) installed mkosi and get the following error:
Running hooks in /etc/ca-certificates/update.d...
done.
W: Unable to read /etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory)
W: Download is performed unsandboxed as root as file '/home/rayben/source/mkosi-intune/mkosi.workspace/7p_nzrvf/root/var/cache/apt/archives/partial/libsystemd0_249.11-0ubuntu3.9_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
‣ Unmounting API VFS…
‣ Unmounting Package Cache
‣ Mounting Package Cache
‣ Running prepare script…
Failed to map ids for bind mount /home/rayben/source/mkosi-intune/mkosi.workspace/7p_nzrvf/root/root/src: Device or resource busy
‣ Error: Workspace command /root/prepare final returned non-zero exit code 1.
I think tried installing mkosi using the verified knowing good checksum you posted for 7/29 with pipx install ... and I also tried just cloning and checkout the commit, and using the mkosi in bin and both seem like there is a signing issue
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.ubuntu.com/ubuntu jammy-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
‣ "apt-get -o APT::Architecture=amd64 -o APT::Architectures=amd64 -o APT::Immediate-Configure=off -o APT::Get::Assume-Yes=true -o APT::Get::AutomaticRemove=true -o APT::Get::Allow-Change-Held-Packages=true -o APT::Get::Allow-Remove-Essential=true -o APT::Sandbox::User=root -o Dir::Cache=/home/rayben/source/mkosi-intune/mkosi.cache/ubuntu~jammy -o Dir::State=/home/rayben/source/mkosi-intune/mkosi.workspace/.mkosi.tmpe332jl_p/pkgmngr/var/lib/apt -o Dir::State::status=/home/rayben/source/mkosi-intune/mkosi.workspace/.mkosi.tmpe332jl_p/root/var/lib/dpkg/status -o Dir::Etc::trusted=/usr/share/keyrings/ubuntu-archive-keyring.gpg -o Dir::Etc::trustedparts=/home/rayben/source/mkosi-intune/mkosi.workspace/.mkosi.tmpe332jl_p/pkgmngr/etc/apt/trusted.gpg.d -o Dir::Log=/home/rayben/source/mkosi-intune/mkosi.workspace/.mkosi.tmpe332jl_p/pkgmngr/var/log/apt -o Dir::Bin::dpkg=/usr/bin/dpkg -o Debug::NoLocking=true -o DPkg::Options::=--root=/home/rayben/source/mkosi-intune/mkosi.workspace/.mkosi.tmpe332jl_p/root -o DPkg::Options::=--log=/home/rayben/source/mkosi-intune/mkosi.workspace/.mkosi.tmpe332jl_p/pkgmngr/var/log/apt/dpkg.log -o DPkg::Options::=--force-unsafe-io -o DPkg::Options::=--force-architecture -o DPkg::Options::=--force-depends -o Dpkg::Use-Pty=false -o DPkg::Install::Recursive::Minimum=1000 -o pkgCacheGen::ForceEssential=, update" returned non-zero exit code 100.
make: *** [Makefile:12: build] Error 100
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.