Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VMware guest additions support for aarch64 #147650

Closed
samuela opened this issue Nov 28, 2021 · 16 comments · Fixed by #242126
Closed

VMware guest additions support for aarch64 #147650

samuela opened this issue Nov 28, 2021 · 16 comments · Fixed by #242126

Comments

@samuela
Copy link
Member

samuela commented Nov 28, 2021

Describe the bug

The virtualisation.vmware.guest.enable = true option does not work on aarch64-linux due to

assertions = [ {
assertion = pkgs.stdenv.hostPlatform.isx86;
message = "VMWare guest is not currently supported on ${pkgs.stdenv.hostPlatform.system}";
} ];

See also https://discourse.nixos.org/t/vmware-guest-tools-on-aarch64-linux/16248.

It seems that the current issue is that xorg.xf86inputvmmouse does not build on aarch64-linux.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Run NixOS on aarch64-linux.
  2. Set the virtualisation.vmware.guest.enable = true option.
  3. Observe the failure.

Expected behavior

aarch64-linux support

Screenshots

n/a

Additional context

See also https://discourse.nixos.org/t/vmware-guest-tools-on-aarch64-linux/16248.

Notify maintainers

@joamaki @anoever @kjeremy

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
- system: aarch64-linux
- host os: Linux 5.10.81, NixOS, 21.05.4361.43bbfd4994c (Okapi)
- multi-user?: yes
- sandbox: yes
- version: nix-env (Nix) 2.3.16
- nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: xorg.xf86inputvmmouse
# a list of nixos modules affected by the problem
module: virtualisation.vmware.guest
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/vmware-guest-tools-on-aarch64-linux/16248/7

@evanrelf
Copy link

evanrelf commented Jan 12, 2022

It looks like xorg.xf86inputvmmouse is only pulled in when virtualisation.vmware.guest.headless = false:

services.xserver = mkIf (!cfg.headless) {
videoDrivers = mkOverride 50 [ "vmware" ];
modules = [ xf86inputvmmouse ];
config = ''
Section "InputClass"
Identifier "VMMouse"
MatchDevicePath "/dev/input/event*"
MatchProduct "ImPS/2 Generic Wheel Mouse"
Driver "vmmouse"
EndSection
'';
displayManager.sessionCommands = ''
${open-vm-tools}/bin/vmware-user-suid-wrapper
'';
};

Maybe the assertion could be relaxed a bit?

     assertions = [ {
-      assertion = pkgs.stdenv.hostPlatform.isx86;
+      assertion = pkgs.stdenv.hostPlatform.isx86 && !cfg.headless;
       message = "VMWare guest is not currently supported on ${pkgs.stdenv.hostPlatform.system}";
    } ];

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 31, 2022
@d4g
Copy link
Contributor

d4g commented Sep 29, 2022

Bump. Please change this so that we can at least use the guest tools in headless mode as mentioned here:

It looks like xorg.xf86inputvmmouse is only pulled in when virtualisation.vmware.guest.headless = false:

services.xserver = mkIf (!cfg.headless) {
videoDrivers = mkOverride 50 [ "vmware" ];
modules = [ xf86inputvmmouse ];
config = ''
Section "InputClass"
Identifier "VMMouse"
MatchDevicePath "/dev/input/event*"
MatchProduct "ImPS/2 Generic Wheel Mouse"
Driver "vmmouse"
EndSection
'';
displayManager.sessionCommands = ''
${open-vm-tools}/bin/vmware-user-suid-wrapper
'';
};

Maybe the assertion could be relaxed a bit?

     assertions = [ {
-      assertion = pkgs.stdenv.hostPlatform.isx86;
+      assertion = pkgs.stdenv.hostPlatform.isx86 && !cfg.headless;
       message = "VMWare guest is not currently supported on ${pkgs.stdenv.hostPlatform.system}";
    } ];

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 29, 2022
@kjeremy
Copy link
Contributor

kjeremy commented Sep 29, 2022

@d4g Can you submit a PR and change the assertion message? This makes sense.

@addict3d
Copy link
Contributor

addict3d commented Oct 5, 2022

@samuela or @d4g could you give #194621 a try?

@addict3d
Copy link
Contributor

addict3d commented Oct 5, 2022

Can you submit a PR and change the assertion message? This makes sense.

@kjeremy Any suggestions on how to update the assertion message?

Am not sure if it should also be conditional.

@d4g
Copy link
Contributor

d4g commented Oct 5, 2022

Can you tell me how to single pick this PR in my configuration? Define an override?

@addict3d
Copy link
Contributor

addict3d commented Oct 6, 2022

Can you tell me how to single pick this PR in my configuration?

Yes. There are multiple ways to do this. So finding the simplest or easiest way will depend on your current setup.

How do you define/import nixpkgs in your configuration?

Define an override?

That'd be one way to do it. AFAIK you'd need to add the vmware-guest.nix file to disabledModules (see "66.7. Replace Modules"), and bind a new nixpkgs reference to my branch, where you'd import that module from.

@abhillman
Copy link
Contributor

AFAICT this is also a blocker for creating a graphical ISO for aarch64:

bash-4.4# nix-build -A config.system.build.isoImage -I nixos-config=modules/installer/cd-dvd/installation-cd-graphical-gnome.nix default.nix
error:
       Failed assertions:
       - VMWare guest is not currently supported on aarch64-linux
(use '--show-trace' to show detailed location information)
bash-4.4# uname -a
Linux 14c6bb46a97a 5.10.124-linuxkit #1 SMP PREEMPT Thu Jun 30 08:18:26 UTC 2022 aarch64 GNU/Linux

@abhillman
Copy link
Contributor

Seems to work on aarch64 for me:

[nix-shell:/nixpkgs/nixos]# git diff
diff --git a/nixos/modules/virtualisation/vmware-guest.nix b/nixos/modules/virtualisation/vmware-guest.nix
index 3b4d484f..c6ee7a40 100644
--- a/nixos/modules/virtualisation/vmware-guest.nix
+++ b/nixos/modules/virtualisation/vmware-guest.nix
@@ -23,7 +23,7 @@ in
 
   config = mkIf cfg.enable {
     assertions = [ {
-      assertion = pkgs.stdenv.hostPlatform.isx86;
+      assertion = pkgs.stdenv.hostPlatform.isx86 || pkgs.stdenv.hostPlatform.isAarch64;
       message = "VMWare guest is not currently supported on ${pkgs.stdenv.hostPlatform.system}";
     } ];

abhillman added a commit to abhillman/nixpkgs that referenced this issue Oct 10, 2022
@d4g
Copy link
Contributor

d4g commented Oct 12, 2022

Does not seem to work for me:

/etc/nixos/configuration.nix:
image

image

Rebuild:
image

Assertion is in vmware.nix:

image

(Sorry for screenshots, but copy/paste does not work yet ... as it requires the vmware guest tools ... )

@bestlem
Copy link

bestlem commented Jan 8, 2023

Any progress - I am a begginer in nixOS.

So the way to learn is setup a VM
But then I hit this.

What are the exact steps to use this PR?

This is not just a mouse issue as the previous comment not it stops cut and paste. It also shops the use of shared folders so a fix is needed for the headless case as well.

@ThorbenJ
Copy link

ThorbenJ commented Jul 3, 2023

I would love to have vmware guest on aarch64 too. I'm running VMWare Fusion on my M1 macbook.

I tried the above, of disabling the vmware-guest.nix and adding my own with the assert modified to accept Aarch64. However it not building x11 mouse is one issue, but even with headless = true it still fails; in this case vmw_vpscsi fails in the kernel build:

image

@kjeremy
Copy link
Contributor

kjeremy commented Jul 7, 2023

@ThorbenJ that's a module that comes with the kernel and not vmware. It looks like it's not supported under non-x86 architectures: https://cateee.net/lkddb/web-lkddb/VMWARE_PVSCSI.html so we should remove it from the module if not on x86

@kjeremy
Copy link
Contributor

kjeremy commented Jul 7, 2023

@ThorbenJ can you test #242126? I don't have aarch64 but this might work.

@ThorbenJ
Copy link

Magic. It built successfully and as soon as nixos-rebuild switch completed my X desktop resized to match my monitor (automatically).

I just used my own local vmware-guest.nix (disabling the system one), in which I made the two changes that are in kjeremy's PR ^

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants