Skip to main content
Topic: [Dinit] How can I enable VMware Tools in my Artix Dinit VM? (Read 643 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[Dinit] How can I enable VMware Tools in my Artix Dinit VM?

Hello there, Artix Community,

After refreshing my memories with runit on Void Linux, I decided to do the Runit Migration Guide for my daily-driver Arch hard drive.
It feels great and it was VERY easy to migrate, but then I noticed a new edition of Artix on the main page of Artix's website, now implementing a relatively new init system called dinit.

dinit has a syntax and general feel reminiscent of systemd, but without the bloat of actual systemd. I thought this was interesting and I wanted to test drive it in a VM (my go-to virtualisation choice for trying out new OSes is VMware Workstation; yes, it's proprietary, but it's less painful to set up compared to KVM and has more features compared to VirtualBox).

But there's a small issue with the installer: it refuses to load. So I just installed vanilla Arch and worked my way up here with the dinit Migration Guide. After I successfully and painlessly got rid of systemd, I noticed that the Artix repositories don't have init scripts for open-vm-tools (the driver needed for stuff like automatically setting the screen resolution after resizing VMware's window), so I turned to the internet and dinit's manpages for help, and this is what I found:

This is the runit version of the shell script I need to run:

Code: [Select]
#!/usr/bin/env sh
# this is translated from the systemd file, there may be errors

# check if os is virtualized on vmware
if [ "$(dmidecode -s system-product-name)" != "VMware Virtual Platform" ]; then exit 0; fi

# create runtime directory
if [ ! -d "/run/vmblock-fuse" ]
then
  mkdir -p "/run/vmblock-fuse"
  chmod 755 "/run/vmblock-fuse"
fi

# start the service
/usr/bin/vmware-vmblock-fuse -d -f -o subtype=vmware-vmblock,default_permissions,allow_other /run/vmblock-fuse

And these are the templates for creating a dinit script:

Code: [Select]
# mysqld service
type = process
command = /usr/bin/mysqld --user=mysql
logfile = /var/log/mysqld.log
smooth-recovery = true
restart = false
depends-on = rcboot # Basic system services must be ready


# rootfscheck service
type = scripted
command = /etc/dinit.d/rootfscheck.sh
restart = false
options = starts-on-console pass-cs-fd
options = start-interruptible skippable
depends-on = early-filesystems  # /proc and /dev
depends-on = device-node-daemon

How could I use things from the runit script to use in the dinit script?

EDIT: So far, this is my progress:

Code: [Select]
# vmtoolsd service
type = process
command = /usr/bin/vmware-vmblock-fuse -d -f -o subtype=vmware-vmblock,default_permissions,allow_other /run/vmblock-fuse
logfile = /var/log/vmtoolsd.log
smooth-recovery = true
restart = true
options = starts-on-console
depends-on = fuse # FUSE system service must be ready

The process runs, but auto-resizing doesn't do anything. How can I fix the code?

EDIT 2: I created the /run/vmblock-fuse directory but it still doesn't run properly.

EDIT 3: I changed this to invoke /usr/bin/vmtoolsd instead and now starting the service hangs the terminal. running the program by itself makes this work, though.

Re: [Dinit] How can I enable VMware Tools in my Artix Dinit VM?

Reply #1
Guys, I think I've cracked the code.

This is the final script you have to put into /etc/dinit.d under the name 'vmtoolsd':

Code: [Select]
# vmtoolsd service
type = process
command = /usr/bin/vmtoolsd -b 555
logfile = /var/log/vmtoolsd.log
smooth-recovery = true
restart = true
depends-on = fuse # FUSE system service must be ready

The issue is... How can I package this script up and send it into the [world] repository where all of these init scripts live, making the life of many Artix dinit users easier?

EDIT: Now I know that I have to create my own PKGBUILD file for this to compile the package, but how can I send it to the Artix repository maintainers for verification?