{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/46527","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/46527/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/46527/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/46527/events","html_url":"https://github.com/NixOS/nixpkgs/issues/46527","id":359093366,"node_id":"MDU6SXNzdWUzNTkwOTMzNjY=","number":46527,"title":"open-vm-tools: /etc/os-release is too large","user":{"login":"rawtaz","id":825204,"node_id":"MDQ6VXNlcjgyNTIwNA==","avatar_url":"https://avatars0.githubusercontent.com/u/825204?v=4","gravatar_id":"","url":"https://api.github.com/users/rawtaz","html_url":"https://github.com/rawtaz","followers_url":"https://api.github.com/users/rawtaz/followers","following_url":"https://api.github.com/users/rawtaz/following{/other_user}","gists_url":"https://api.github.com/users/rawtaz/gists{/gist_id}","starred_url":"https://api.github.com/users/rawtaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rawtaz/subscriptions","organizations_url":"https://api.github.com/users/rawtaz/orgs","repos_url":"https://api.github.com/users/rawtaz/repos","events_url":"https://api.github.com/users/rawtaz/events{/privacy}","received_events_url":"https://api.github.com/users/rawtaz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-09-11T15:12:51Z","updated_at":"2018-09-18T11:00:12Z","closed_at":null,"author_association":"NONE","body":"## Issue description\r\nThe `vmwareGuest` service fails to start, giving the following error messages in ``/var/log/vmware-vmsvc.log``:\r\n~~~\r\n[Sep 11 14:50:09.578] [ warning] [vmsvc] HostinfoReadDistroFile: input buffer too small\r\n[Sep 11 14:50:09.578] [ warning] [vmsvc] HostinfoOSData: Error: no distro file found\r\n[Sep 11 14:50:09.578] [ warning] [guestinfo] Failed to get OS info.\r\n~~~\r\n\r\n### Steps to reproduce\r\n- Install a fresh copy of NixOS 18.03 in a VM under VMware Fusion 10.1.3 on macOS 10.12.x.\r\n- Configure relevant parts in `/etc/nixos/configuration.nix`, e.g.:\r\n~~~\r\n# Edit this configuration file to define what should be installed on\r\n# your system.  Help is available in the configuration.nix(5) man page\r\n# and in the NixOS manual (accessible by running ‘nixos-help’).\r\n\r\n{ config, pkgs, ... }:\r\n\r\n{\r\n  imports =\r\n    [ # Include the results of the hardware scan.\r\n      ./hardware-configuration.nix\r\n    ];\r\n\r\n  # Use the GRUB 2 boot loader.\r\n  boot.loader.grub.enable = true;\r\n  boot.loader.grub.version = 2;\r\n  # boot.loader.grub.efiSupport = true;\r\n  # boot.loader.grub.efiInstallAsRemovable = true;\r\n  # boot.loader.efi.efiSysMountPoint = \"/boot/efi\";\r\n  # Define on which hard drive you want to install Grub.\r\n  boot.loader.grub.device = \"/dev/sda\"; # or \"nodev\" for efi only\r\n\r\n  # networking.hostName = \"nixos\"; # Define your hostname.\r\n  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.\r\n\r\n  # Select internationalisation properties.\r\n  # i18n = {\r\n  #   consoleFont = \"Lat2-Terminus16\";\r\n  #   consoleKeyMap = \"us\";\r\n  #   defaultLocale = \"en_US.UTF-8\";\r\n  # };\r\n\r\n  # Set your time zone.\r\n  # time.timeZone = \"Europe/Amsterdam\";\r\n\r\n  # List packages installed in system profile. To search, run:\r\n  # $ nix search wget\r\n  environment.systemPackages = with pkgs; [\r\n    mkpasswd\r\n    vim\r\n    rxvt_unicode\r\n    firefox\r\n  ];\r\n\r\n  # Some programs need SUID wrappers, can be configured further or are\r\n  # started in user sessions.\r\n  # programs.bash.enableCompletion = true;\r\n  # programs.mtr.enable = true;\r\n  # programs.gnupg.agent = { enable = true; enableSSHSupport = true; };\r\n\r\n  # List services that you want to enable:\r\n\r\n  # Enable the OpenSSH daemon.\r\n  services.openssh.enable = true;\r\n\r\n  # Open ports in the firewall.\r\n  # networking.firewall.allowedTCPPorts = [ ... ];\r\n  # networking.firewall.allowedUDPPorts = [ ... ];\r\n  # Or disable the firewall altogether.\r\n  # networking.firewall.enable = false;\r\n\r\n  # Enable CUPS to print documents.\r\n  # services.printing.enable = true;\r\n\r\n  # Enable sound.\r\n  # sound.enable = true;\r\n  # hardware.pulseaudio.enable = true;\r\n\r\n  # Enable the X11 windowing system.\r\n  # services.xserver.enable = true;\r\n  # services.xserver.layout = \"us\";\r\n  # services.xserver.xkbOptions = \"eurosign:e\";\r\n\r\n  # Enable touchpad support.\r\n  # services.xserver.libinput.enable = true;\r\n\r\n  # Enable the KDE Desktop Environment.\r\n  # services.xserver.displayManager.sddm.enable = true;\r\n  # services.xserver.desktopManager.plasma5.enable = true;\r\n\r\n  # Define a user account. Don't forget to set a password with ‘passwd’.\r\n  users.extraUsers.rawtaz = {\r\n    isNormalUser = true;\r\n    uid = 1000;\r\n    extraGroups = [\"wheel\"];\r\n  };\r\n\r\n  # This value determines the NixOS release with which your system is to be\r\n  # compatible, in order to avoid breaking some software such as database\r\n  # servers. You should change this only after NixOS release notes say you\r\n  # should.\r\n  system.stateVersion = \"18.03\"; # Did you read the comment?\r\n\r\n  services.vmwareGuest.enable = true;\r\n  services.vmwareGuest.headless = true;\r\n  services.xserver.enable = true;\r\n  services.xserver.windowManager.i3.enable = true;\r\n  services.xserver.displayManager.lightdm.enable = true;\r\n}\r\n~~~\r\n\r\n## Technical details\r\n~~~\r\n - system: `\"x86_64-linux\"`\r\n - host os: `Linux 4.14.67, NixOS, 18.03.133192.45f52f765cd (Impala)`\r\n - multi-user?: `yes`\r\n - sandbox: `no`\r\n - version: `nix-env (Nix) 2.0.4`\r\n - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs`\r\n~~~\r\n\r\n## Further comments and workaround\r\nBased on the code in https://github.com/vmware/open-vm-tools/blob/3a0205478e242bd672356d4eab6272d3b901fe6e/open-vm-tools/lib/misc/hostinfoPosix.c#L932 it seems that the contents of the file `/etc/os-release`, which is scanned by `open-vm-tools`, is simply too large:\r\n~~~\r\nNAME=NixOS\r\nID=nixos\r\nVERSION=\"18.03.133192.45f52f765cd (Impala)\"\r\nVERSION_CODENAME=impala\r\nVERSION_ID=\"18.03.133192.45f52f765cd\"\r\nPRETTY_NAME=\"NixOS 18.03.133192.45f52f765cd (Impala)\"\r\nHOME_URL=\"https://nixos.org/\"\r\nSUPPORT_URL=\"https://nixos.org/nixos/support.html\"\r\nBUG_REPORT_URL=\"https://github.com/NixOS/nixpkgs/issues\"\r\n~~~\r\n\r\nI tested that by creating a file `/etc/release` (which is also scanned by `open-vm-tools`), with only part of the contents:\r\n~~~\r\nNAME=NixOS\r\nID=nixos\r\nVERSION=\"18.03.133192.45f52f765cd (Impala)\"\r\nVERSION_CODENAME=impala\r\nVERSION_ID=\"18.03.133192.45f52f765cd\"\r\nPRETTY_NAME=\"NixOS 18.03.133192.45f52f765cd (Impala)\"\r\n~~~\r\n\r\nAfter a few seconds, when the `vmwareGuest` service tries to start again, there's only one of the previously three error messages in ``/var/log/vmware-vmsvc.log``:\r\n~~~\r\n[Sep 11 14:50:09.578] [ warning] [vmsvc] HostinfoReadDistroFile: input buffer too small\r\n~~~\r\n\r\nThe `vmwareGuest` service started, the above error message is for the still remaining and too large `/etc/os-release` file (to verify, let the contents of `/etc/release` be identical to that of `/etc/os-release` and notice that the other error messages comes back in the log file)."},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/422349868","html_url":"https://github.com/NixOS/nixpkgs/issues/46527#issuecomment-422349868","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/46527","id":422349868,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjM0OTg2OA==","user":{"login":"aanderse","id":7755101,"node_id":"MDQ6VXNlcjc3NTUxMDE=","avatar_url":"https://avatars2.githubusercontent.com/u/7755101?v=4","gravatar_id":"","url":"https://api.github.com/users/aanderse","html_url":"https://github.com/aanderse","followers_url":"https://api.github.com/users/aanderse/followers","following_url":"https://api.github.com/users/aanderse/following{/other_user}","gists_url":"https://api.github.com/users/aanderse/gists{/gist_id}","starred_url":"https://api.github.com/users/aanderse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aanderse/subscriptions","organizations_url":"https://api.github.com/users/aanderse/orgs","repos_url":"https://api.github.com/users/aanderse/repos","events_url":"https://api.github.com/users/aanderse/events{/privacy}","received_events_url":"https://api.github.com/users/aanderse/received_events","type":"User","site_admin":false},"created_at":"2018-09-18T11:00:12Z","updated_at":"2018-09-18T11:00:12Z","author_association":"CONTRIBUTOR","body":"@rawtaz I didn't review the openvm-tools closely enough to say but after a quick glance it appears that the source file you linked can use the output of lsb_release to identify the distro.\r\n\r\nhttps://github.com/vmware/open-vm-tools/blob/3a0205478e242bd672356d4eab6272d3b901fe6e/open-vm-tools/lib/misc/hostinfoPosix.c#L1132\r\n\r\nI wondered if adding a quick substitution in the source code to ${pkgs.lsb-release}/bin/lsb_release for /usr/bin/lsb_release might be enough to identify the distro."}}
{"actor":{"display_login":"aanderse"}}