[PATCH 0/2] gnu: Add VMware open-vm-tools.

  • Done
  • quality assurance status badge
Details
2 participants
  • Andrew Tropin
  • Sharlatan Hellseher
Owner
unassigned
Submitted by
Sharlatan Hellseher
Severity
normal
S
S
Sharlatan Hellseher wrote on 17 Sep 2023 13:05
(address . guix-patches@gnu.org)(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
cover.1694948061.git.sharlatanus@gmail.com
Hi Guix!

The first buildable version for VMware open-vm-tools guest machine running on
top of VMware host. The functionality is similar to qemu-guest-agent and
helps to interact with a guest vm from the host.

I've built it just on x86_64-linux, support for other architecture and OSes
might need more work. Also as this software intends to be a daemon running on
guest - Guix service needs to be added in the future.

Unfortunately, I've got no VMware instance right now to test it operationally,
please report if the strict testing is required.

Thanks,
Oleg

Sharlatan Hellseher (2):
gnu: Add VMware open-vm-tools.
gnu: Sort use-module in (gnu packages virtualization) alphabetically.

gnu/packages/virtualization.scm | 164 +++++++++++++++++++++++++++++++-
1 file changed, 159 insertions(+), 5 deletions(-)


base-commit: 9b78699744b0c4c8af28820cc4f0d59b9d317ead
--
2.41.0
S
S
Sharlatan Hellseher wrote on 17 Sep 2023 13:06
[PATCH 1/2] gnu: Add VMware open-vm-tools.
(address . 66047@debbugs.gnu.org)(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
c4011be027f91668706486fad3e77a5f81bbc740.1694948061.git.sharlatanus@gmail.com
* gnu/packages/virtualization.scm (vmware-open-vm-tools,
vmware-open-vm-tools-gtk): New variables.
---
gnu/packages/virtualization.scm | 154 ++++++++++++++++++++++++++++++++
1 file changed, 154 insertions(+)

Toggle diff (181 lines)
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index f5bdedd45e..04ed253e8a 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -30,6 +30,7 @@
;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
;;; Copyright © 2023 Juliana Sims <juli@incana.org>
;;; Copyright © 2023 Ahmad Draidi <a.r.draidi@redscript.org>
+;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -65,6 +66,7 @@ (define-module (gnu packages virtualization)
#:use-module (gnu packages compression)
#:use-module (gnu packages containers)
#:use-module (gnu packages cross-base)
+ #:use-module (gnu packages crypto)
#:use-module (gnu packages cryptsetup)
#:use-module (gnu packages curl)
#:use-module (gnu packages cyrus-sasl)
@@ -1722,6 +1724,158 @@ (define-public virt-manager
domains, their live performance and resource utilization statistics.")
(license license:gpl2+)))
+(define-public vmware-open-vm-tools
+ (package
+ (name "vmware-open-vm-tools")
+ (version "12.3.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/vmware/open-vm-tools")
+ (commit (string-append "stable-" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1hbimhady0v1kd45azknl1lgzgldhgdjd7bj540rn3y4cai5cnk1"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:configure-flags
+ #~(list "--with-fuse=fuse3"
+ "--without-kernel-modules"
+ "--without-x"
+ (string-append
+ "--with-udev-rules-dir=" #$output "/lib/udev/rules.d"))
+ ;; TODO: Add iproute2 dbus which commands wrap.
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'chdir
+ (lambda _
+ (chdir "open-vm-tools")))
+ (replace 'bootstrap
+ (lambda _
+ (system* "autoreconf" "-if")))
+ (add-after 'bootstrap 'patch-paths
+ (lambda _
+ (substitute* "Makefile.am"
+ (("/etc/vmware-tools/")
+ (string-append #$output "/etc/vmware-tools/")))
+ (substitute* "scripts/Makefile.am"
+ (("/etc/vmware-tools")
+ (string-append #$output "/etc/vmware-tools"))
+ (("/usr/bin")
+ (string-append #$output "/bin")))
+ (substitute* "services/vmtoolsd/Makefile.am"
+ (("/etc/vmware-tools")
+ (string-append #$output "/etc/vmware-tools"))
+ (("\\$\\(PAM_PREFIX\\)")
+ (string-append #$output "/$(PAM_PREFIX)")))
+ (substitute* "vgauth/service/Makefile.am"
+ (("/etc/vmware-tools/vgauth/schemas")
+ (string-append #$output "/etc/vmware-tools/vgauth/schemas"))
+ (("etc/vmware-tools/vgauth.conf")
+ (string-append #$output "/etc/vmware-tools/vgauth.conf")))
+ (substitute* "vmhgfs-fuse/config.c"
+ (("/bin/fusermount3")
+ (string-append
+ #$(this-package-input "fuse") "/bin/fusermount3")))
+ ;; XXX: This part might need more testing with shutdown and halt
+ ;; commands provided by Shepherd.
+ (substitute* "lib/system/systemLinux.c"
+ (("/sbin/shutdown")
+ (string-append
+ #$(this-package-input "shepherd") "/sbin/shutdown"))
+ (("/bin/reboot")
+ (string-append
+ #$(this-package-input "shepherd") "/sbin/reboot")))
+ (substitute* "services/plugins/vix/foundryToolsDaemon.c"
+ (("/bin/mount")
+ (string-append
+ #$(this-package-input "util-linux") "/bin/mount"))
+ (("/usr/bin/vmhgfs-fuse")
+ (string-append #$output "/bin/vmhgfs-fuse"))))))))
+ (native-inputs
+ (list `(,glib "bin") ; for glib-genmarshal
+ autoconf
+ automake
+ libltdl
+ libtool
+ pkg-config))
+ (inputs
+ (list eudev
+ fuse
+ glib
+ xmlsec
+ libmspack
+ ;; libdnet ; Not packed
+ libtirpc
+ libxcrypt
+ libxml2
+ linux-pam
+ openssl
+ procps
+ rpcsvc-proto
+ shepherd ;for 'halt' and 'reboot', invoked from VMWare host.
+ util-linux
+ xmlsec))
+ (home-page "https://github.com/vmware/open-vm-tools")
+ (synopsis "Tools for VMWare guest VM to enhance host-guest integration")
+ (description
+ "@code{open-vm-tools} is a set of services and modules that enable several
+features in VMware products for better management of, and seamless user
+interactions with, guests. It includes kernel modules for enhancing the
+performance of virtual machines running Linux or other VMware supported Unix
+like guest operating systems.
+
+@code{open-vm-tools} enables the following features in VMware products:
+
+@itemize
+@item The ability to perform virtual machine power operations gracefully.
+@item Execution of VMware provided or user configured scripts in guests during
+various power operations.
+@item The ability to run programs, commands and file system operation in guests
+to enhance guest automation.
+@item Authentication for guest operations.
+@item Periodic collection of network, disk, and memory usage information from
+the guest.
+@item Generation of heartbeat from guests to hosts so VMware's HA solution can
+determine guests' availability.
+@item Clock synchronization between guests and hosts or client desktops.
+@item Quiescing guest file systems to allow hosts to capture
+file-system-consistent guest snapshots.
+@item Execution of pre-freeze and post-thaw scripts while quiescing guest file
+systems.
+@item The ability to customize guest operating systems immediately after
+powering on virtual machines.
+@item Enabling shared folders between host and guest file systems on VMware
+Workstation and VMware Fusion.
+@item Copying and pasting text, graphics, and files between guests and hosts or
+client desktops.
+@end itemize")
+ (license license:gpl2)))
+
+(define-public vmware-open-vm-tools-gtk
+ (package/inherit vmware-open-vm-tools
+ (name "vmware-open-vm-tools-gtk")
+ (inputs
+ (modify-inputs (package-inputs vmware-open-vm-tools)
+ (prepend gdk-pixbuf-xlib
+ gtk+
+ gtkmm-3
+ libdrm
+ libx11
+ libxext
+ libxi
+ libxinerama
+ libxrandr
+ libxrender
+ libxtst)))
+ (arguments
+ (substitute-keyword-arguments (package-arguments vmware-open-vm-tools)
+ ((#:configure-flags flags)
+ #~(delete "--without-x" #$flags))))
+ (description "This package provides a GTK+ support for @code{open-vm-tools}.")))
+
(define-public criu
(package
(name "criu")
--
2.41.0
S
S
Sharlatan Hellseher wrote on 17 Sep 2023 13:06
[PATCH 2/2] gnu: Sort use-module in (gnu packages virtualization) alphabetically.
(address . 66047@debbugs.gnu.org)(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
6b678cb714197448c63fb170cfc8a07cf3242e62.1694948061.git.sharlatanus@gmail.com
* gnu/packages/virtualization.scm. Sort use-module alphabetically to
easy maintenance.
---
gnu/packages/virtualization.scm | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

Toggle diff (55 lines)
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 04ed253e8a..f30ed75433 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -81,8 +81,8 @@ (define-module (gnu packages virtualization)
#:use-module (gnu packages fonts)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages freedesktop)
- #:use-module (gnu packages gettext)
#:use-module (gnu packages gcc)
+ #:use-module (gnu packages gettext)
#:use-module (gnu packages gl)
#:use-module (gnu packages glib)
#:use-module (gnu packages gnome)
@@ -115,17 +115,17 @@ (define-module (gnu packages virtualization)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages polkit)
#:use-module (gnu packages protobuf)
+ #:use-module (gnu packages pulseaudio)
#:use-module (gnu packages python)
#:use-module (gnu packages python-build)
#:use-module (gnu packages python-check)
#:use-module (gnu packages python-crypto)
#:use-module (gnu packages python-web)
#:use-module (gnu packages python-xyz)
- #:use-module (gnu packages pulseaudio)
#:use-module (gnu packages readline)
#:use-module (gnu packages rsync)
- #:use-module (gnu packages selinux)
#:use-module (gnu packages sdl)
+ #:use-module (gnu packages selinux)
#:use-module (gnu packages sphinx)
#:use-module (gnu packages spice)
#:use-module (gnu packages ssh)
@@ -137,6 +137,7 @@ (define-module (gnu packages virtualization)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg)
+ #:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
#:use-module (guix build-system go)
@@ -144,9 +145,8 @@ (define-module (gnu packages virtualization)
#:use-module (guix build-system python)
#:use-module (guix build-system trivial)
#:use-module (guix download)
- #:use-module (guix git-download)
#:use-module (guix gexp)
- #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix git-download)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (srfi srfi-1)
--
2.41.0
A
A
Andrew Tropin wrote on 18 Oct 2023 11:56
Re: [bug#66047] [PATCH 1/2] gnu: Add VMware open-vm-tools.
(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
877cnkckza.fsf@trop.in
On 2023-09-17 12:06, Sharlatan Hellseher wrote:

Toggle quote (133 lines)
> * gnu/packages/virtualization.scm (vmware-open-vm-tools,
> vmware-open-vm-tools-gtk): New variables.
> ---
> gnu/packages/virtualization.scm | 154 ++++++++++++++++++++++++++++++++
> 1 file changed, 154 insertions(+)
>
> diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
> index f5bdedd45e..04ed253e8a 100644
> --- a/gnu/packages/virtualization.scm
> +++ b/gnu/packages/virtualization.scm
> @@ -30,6 +30,7 @@
> ;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
> ;;; Copyright © 2023 Juliana Sims <juli@incana.org>
> ;;; Copyright © 2023 Ahmad Draidi <a.r.draidi@redscript.org>
> +;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -65,6 +66,7 @@ (define-module (gnu packages virtualization)
> #:use-module (gnu packages compression)
> #:use-module (gnu packages containers)
> #:use-module (gnu packages cross-base)
> + #:use-module (gnu packages crypto)
> #:use-module (gnu packages cryptsetup)
> #:use-module (gnu packages curl)
> #:use-module (gnu packages cyrus-sasl)
> @@ -1722,6 +1724,158 @@ (define-public virt-manager
> domains, their live performance and resource utilization statistics.")
> (license license:gpl2+)))
>
> +(define-public vmware-open-vm-tools
> + (package
> + (name "vmware-open-vm-tools")
> + (version "12.3.0")
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/vmware/open-vm-tools")
> + (commit (string-append "stable-" version))))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32 "1hbimhady0v1kd45azknl1lgzgldhgdjd7bj540rn3y4cai5cnk1"))))
> + (build-system gnu-build-system)
> + (arguments
> + (list
> + #:configure-flags
> + #~(list "--with-fuse=fuse3"
> + "--without-kernel-modules"
> + "--without-x"
> + (string-append
> + "--with-udev-rules-dir=" #$output "/lib/udev/rules.d"))
> + ;; TODO: Add iproute2 dbus which commands wrap.
> + #:phases
> + #~(modify-phases %standard-phases
> + (add-after 'unpack 'chdir
> + (lambda _
> + (chdir "open-vm-tools")))
> + (replace 'bootstrap
> + (lambda _
> + (system* "autoreconf" "-if")))
> + (add-after 'bootstrap 'patch-paths
> + (lambda _
> + (substitute* "Makefile.am"
> + (("/etc/vmware-tools/")
> + (string-append #$output "/etc/vmware-tools/")))
> + (substitute* "scripts/Makefile.am"
> + (("/etc/vmware-tools")
> + (string-append #$output "/etc/vmware-tools"))
> + (("/usr/bin")
> + (string-append #$output "/bin")))
> + (substitute* "services/vmtoolsd/Makefile.am"
> + (("/etc/vmware-tools")
> + (string-append #$output "/etc/vmware-tools"))
> + (("\\$\\(PAM_PREFIX\\)")
> + (string-append #$output "/$(PAM_PREFIX)")))
> + (substitute* "vgauth/service/Makefile.am"
> + (("/etc/vmware-tools/vgauth/schemas")
> + (string-append #$output "/etc/vmware-tools/vgauth/schemas"))
> + (("etc/vmware-tools/vgauth.conf")
> + (string-append #$output "/etc/vmware-tools/vgauth.conf")))
> + (substitute* "vmhgfs-fuse/config.c"
> + (("/bin/fusermount3")
> + (string-append
> + #$(this-package-input "fuse") "/bin/fusermount3")))
> + ;; XXX: This part might need more testing with shutdown and halt
> + ;; commands provided by Shepherd.
> + (substitute* "lib/system/systemLinux.c"
> + (("/sbin/shutdown")
> + (string-append
> + #$(this-package-input "shepherd") "/sbin/shutdown"))
> + (("/bin/reboot")
> + (string-append
> + #$(this-package-input "shepherd") "/sbin/reboot")))
> + (substitute* "services/plugins/vix/foundryToolsDaemon.c"
> + (("/bin/mount")
> + (string-append
> + #$(this-package-input "util-linux") "/bin/mount"))
> + (("/usr/bin/vmhgfs-fuse")
> + (string-append #$output "/bin/vmhgfs-fuse"))))))))
> + (native-inputs
> + (list `(,glib "bin") ; for glib-genmarshal
> + autoconf
> + automake
> + libltdl
> + libtool
> + pkg-config))
> + (inputs
> + (list eudev
> + fuse
> + glib
> + xmlsec
> + libmspack
> + ;; libdnet ; Not packed
> + libtirpc
> + libxcrypt
> + libxml2
> + linux-pam
> + openssl
> + procps
> + rpcsvc-proto
> + shepherd ;for 'halt' and 'reboot', invoked from VMWare host.
> + util-linux
> + xmlsec))
> + (home-page "https://github.com/vmware/open-vm-tools")
> + (synopsis "Tools for VMWare guest VM to enhance host-guest integration")
> + (description
> + "@code{open-vm-tools} is a set of services and modules that enable several
> +features in VMware products for better management of, and seamless user
> +interactions with, guests. It includes kernel modules for enhancing the
> +performance of virtual machines running Linux or other VMware supported Unix
> +like guest operating systems.

The package built without kernel modules, so I remove this sentence from
description.

Toggle quote (54 lines)
> +
> +@code{open-vm-tools} enables the following features in VMware products:
> +
> +@itemize
> +@item The ability to perform virtual machine power operations gracefully.
> +@item Execution of VMware provided or user configured scripts in guests during
> +various power operations.
> +@item The ability to run programs, commands and file system operation in guests
> +to enhance guest automation.
> +@item Authentication for guest operations.
> +@item Periodic collection of network, disk, and memory usage information from
> +the guest.
> +@item Generation of heartbeat from guests to hosts so VMware's HA solution can
> +determine guests' availability.
> +@item Clock synchronization between guests and hosts or client desktops.
> +@item Quiescing guest file systems to allow hosts to capture
> +file-system-consistent guest snapshots.
> +@item Execution of pre-freeze and post-thaw scripts while quiescing guest file
> +systems.
> +@item The ability to customize guest operating systems immediately after
> +powering on virtual machines.
> +@item Enabling shared folders between host and guest file systems on VMware
> +Workstation and VMware Fusion.
> +@item Copying and pasting text, graphics, and files between guests and hosts or
> +client desktops.
> +@end itemize")
> + (license license:gpl2)))
> +
> +(define-public vmware-open-vm-tools-gtk
> + (package/inherit vmware-open-vm-tools
> + (name "vmware-open-vm-tools-gtk")
> + (inputs
> + (modify-inputs (package-inputs vmware-open-vm-tools)
> + (prepend gdk-pixbuf-xlib
> + gtk+
> + gtkmm-3
> + libdrm
> + libx11
> + libxext
> + libxi
> + libxinerama
> + libxrandr
> + libxrender
> + libxtst)))
> + (arguments
> + (substitute-keyword-arguments (package-arguments vmware-open-vm-tools)
> + ((#:configure-flags flags)
> + #~(delete "--without-x" #$flags))))
> + (description "This package provides a GTK+ support for @code{open-vm-tools}.")))
> +
> (define-public criu
> (package
> (name "criu")

Thank you very much for the patches! Applied, pushed.

--
Best regards,
Andrew Tropin
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmUvq8kACgkQIgjSCVjB
3rDLoA/+Pu8sXJn/ctz9rtqMQISf8dgJAT2fzxlDC80z4yXhy/rNOSRfCMholk0V
3d2jEojNf0Kr9V47CABXc9nWHE7M9jC9L3WAjLpjyAX9BaNYoYRvNAYYgINnTxBW
vIGxT1zF8c6pS1nnzdtFbZboFwcrdK3glYtzVLcHKFfyJH4qf4r+1JjO4Ybhnhoj
g8tNZkATMY2SX34p38HHL44b22sSv4+38mTSPs0WoBAdR6dc+K26yVrLqqfLrEt3
T/FHdW9/z6smcMd3z2xZ9K6SAj4xJ1WrlXrbLuY9jjgmJgOwGX0uVZX8angt85XJ
TqlsNL+Ni4L/yK3PB1NAapm0ldLHe7MmQ8VU1kam3T/jYU9ubzQh8+kNAD8s2e1q
9mAdUtiVNQDKEDAJBTyOBErnvuqX93rHhh2j88sSLsiqKiaZkWg/mNe7dSz0PJQp
99ZLnpXcbc97JimNeKlwmRSh5Zeo9BxPw6ub1cXe4z+0JEquJfXJRQ/UgqlJ3lqS
Yvgypzk9qGopgXFklTTiCrLU3if02E5ccbrrV1YItVrYihBRRCvzGEXQKh5UfAXv
oPlCX3BweLhIFxuYgzHoh7vP1zWyg34cX2h1fig3N9s3zFDgwNompg8qy/n+a/Yy
ZZRcs5YD3WftmSL6W/0iwkoetARiFP+bw9Bk2f3k6l8W9hxQpcQ=
=2LBy
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 66047@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 66047
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch