Commit 9022864f authored by Naoki OKAMURA's avatar Naoki OKAMURA

change: use VMware Workstation Player again

parent a5cf32a0
......@@ -10,10 +10,10 @@
"wheel" "docker"
# gui
"audio" "video" "render" "disk" "input" "storage"
"audio" "video" "render" "disk" "input" "storage" "lightdm"
# vm
"kvm" "libvirtd"
# "kvm" "libvirtd"
];
home = "/home/nyarla";
isNormalUser = true;
......
......@@ -7,21 +7,21 @@ let
'';
vmci-src = requireFile {
name = "vmci.tar";
sha256 = "14hz1ca0gxb4wm1ilq131b96j14sxaqplyvyn7xmjav8pckd2b23";
sha256 = "1jr8j9iqwj0rmjhiqn80g3cpfaass7wfn57y2y1jxrkaadv76mbk";
message = message;
};
vsock-src = requireFile {
name = "vsock.tar";
sha256 = "1sz78yl14fwv4a5sd64qxsq7vz6briq7mss7d8qnplxmp0j45d9p";
sha256 = "046vkhpzvslfi5335g01rgyr8zc824svq51zzmby583cvp4771jm";
message = message;
};
host-src = fetchurl {
url = "https://codeload.github.com/mkubecek/vmware-host-modules/tar.gz/p15.1.0-k5.1";
sha256 = "1bb9a39w8bc3snxi69hnbw6naw57blgad16cf443hf7iq72bs9mr";
url = "https://codeload.github.com/mkubecek/vmware-host-modules/tar.gz/p15.5.0-k5.3";
sha256 = "0rg8x9gamx9bn3fb28r1bdrvx1x3n82iw12a9bfysvwkq011c9yr";
};
in stdenv.mkDerivation rec {
name = "vmware-host-modules-${version}";
version = "15.1.0";
version = "15.5.0";
srcs = [ vmci-src vsock-src host-src ];
hardeningDisable = [
......@@ -44,6 +44,7 @@ in stdenv.mkDerivation rec {
cp -R tmp/vmware-host-*/vmnet-only ./
cp -R tmp/vmci-only ./
cp -R tmp/vsock-only ./
chmod +w -R tmp
rm -rf tmp
'';
......
......@@ -242,62 +242,6 @@ index b40e9b6..3c81442 100644
/*
* Bug 827422 and 838523.
diff --git a/vmci-only/shared/vm_device_version.h b/vmci-only/shared/vm_device_version.h
index 39371ad..718cbd0 100644
--- a/vmci-only/shared/vm_device_version.h
+++ b/vmci-only/shared/vm_device_version.h
@@ -53,7 +53,9 @@
* VMware HD Audio codec
* VMware HD Audio controller
*/
+#ifndef PCI_VENDOR_ID_VMWARE
#define PCI_VENDOR_ID_VMWARE 0x15AD
+#endif
#define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405
#define PCI_DEVICE_ID_VMWARE_SVGA 0x0710
#define PCI_DEVICE_ID_VMWARE_VGA 0x0711
diff --git a/vmmon-only/linux/hostif.c b/vmmon-only/linux/hostif.c
index 21758c2..e1c9aaa 100644
--- a/vmmon-only/linux/hostif.c
+++ b/vmmon-only/linux/hostif.c
@@ -93,6 +93,37 @@
#define UPTIME_FREQ CONST64(1000000)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
+#define global_zone_page_state global_page_state
+#endif
+
+static unsigned long get_nr_slab_unreclaimable(void)
+{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
+ return global_node_page_state(NR_SLAB_UNRECLAIMABLE);
+#else
+ return global_page_state(NR_SLAB_UNRECLAIMABLE);
+#endif
+}
+
+static unsigned long get_nr_unevictable(void)
+{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+ return global_node_page_state(NR_UNEVICTABLE);
+#else
+ return global_page_state(NR_UNEVICTABLE);
+#endif
+}
+
+static unsigned long get_nr_anon_mapped(void)
+{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+ return global_node_page_state(NR_ANON_MAPPED);
+#else
+ return global_page_state(NR_ANON_PAGES);
+#endif
+}
+
/*
* When CONFIG_NO_HZ_FULL is set processors can run tickless
* if there is only one runnable process. When set, the rate
diff --git a/vsock-only/linux/af_vsock.c b/vsock-only/linux/af_vsock.c
index c068a1a..f0f81fe 100644
--- a/vsock-only/linux/af_vsock.c
......
......@@ -15,4 +15,8 @@ RUN apt-get update \
&& apt-get clean -y \
&& rm -rf /var/cache/apt/archive/* /var/lib/apt/lists/*
RUN echo '%wheel ALL=(ALL) NOPASSWD:ALL' >/etc/sudoers.d/wheel \
&& rm /usr/bin/pkexec \
&& ln -sf /usr/bin/sudo /usr/bin/pkexec
ENTRYPOINT ["/bin/bash"]
#!/usr/bin/env bash
state=$HOME/local/dockerapp/vmware
state=$HOME/local/docker/vmware
docker run --rm -it --init \
\
......
#!/usr/bin/env bash
state=$HOME/local/dockerapp/vmware
state=$HOME/local/docker/vmware
test -d $state/isoimages || mkdir -p $state/isoimages
test -d $state/src || mkdir -p $state/src
......
#!/usr/bin/env bash
state=$HOME/local/dockerapp/vmware
state=$HOME/local/docker/vmware
docker run -it --init --name="vmware-postbuild" \
--volume=$HOME/Downloads/VMware-Player-15.1.0-13591040.x86_64.bundle:/tmp/vmware.bundle:ro \
--volume=$HOME/Downloads/VMware-Player-15.5.0-14665864.x86_64.bundle:/tmp/vmware.bundle:ro \
\
--volume=/home/$(id -un)/local/dockerapp/vmware:/app:rw \
--volume=/home/$(id -un)/local/docker/vmware:/app:rw \
\
$USER:vmware -c "\
bash /tmp/vmware.bundle --console --required --eulas-agreed \
&& git clone --depth 1 https://github.com/DrDonk/unlocker \
&& cd unlocker && bash lnx-install.sh \
&& sed -i 's/if \"\$BINDIR\"\/vmware-modconfig --appname=.*/if true ||/' /usr/bin/vmplayer \
"
......
#!/usr/bin/env bash
export PATH=/run/current-system/sw/bin:$PATH
export HOME=/home/$(id -un)
exec 2>&1 >$HOME/local/dockerapp/vmware/debug.log
exec 2>&1 >$HOME/local/docker/vmware/debug.log
set -e -u -o pipefail
state=$HOME/local/dockerapp/vmware
cp /var/run/lightdm/$USER/xauthority /tmp/.Xauthority
state=$HOME/local/docker/vmware
docker run --rm -t --init --privileged --net host \
--volume=/etc/group:/etc/group:ro \
--volume=/etc/passwd:/etc/passwd:ro \
--volume=/etc/shadow:/etc/shadow:ro \
--volume=/etc/asound.conf:/etc/asound.conf:ro \
\
--device=/dev \
--volume=/sys:/sys:ro \
--volume=/run/opengl-driver:/opt/opengl-driver:ro \
\
--volume=/nix:/nix:ro \
--volume=/run/current-system/sw/bin:/run/current-system/sw/bin:ro \
--volume=/run/opengl-driver:/opt/opengl-driver:ro \
--volume=/etc/fonts:/etc/fonts:ro \
\
--volume=/run/user/$(id -u)/gdm/Xauthority:/tmp/.Xauthority:ro \
--volume=/home/$(id -un)/.config/skk/SKK-JISYO.XL:/tmp/SKK:ro \
\
--volume=/tmp/.X11-unix:/tmp/.X11-unix:rw \
--volume=/run/user/$(id -u)/pulse:/run/media/$(id -u)/pulse:rw \
--volume=/run/user/$(id -u)/bus:/run/user/$(id -u)/bus \
\
--volume=$state/vmware:/etc/vmware:rw \
--volume=$state/isoimages:/usr/lib/vmware/isoimages:rw \
--volume=$state/home:/app:rw \
--volume=$HOME/local/vm:/data/vm:rw \
--volume=/data/active:/data/active:rw \
--volume=$HOME/Downloads:/data/downloads:rw \
\
--env=DISPLAY=$DISPLAY \
--env=XAUTHORITY=/tmp/.Xauthority \
--env=LD_LIBRARY_PATH=/opt/opengl-driver \
--env=HOME=/app \
--env=DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS \
docker run --rm -t --init --privileged --net host \
--mount type=bind,src=/etc/group,dst=/etc/group,readonly \
--mount type=bind,src=/etc/shells,dst=/etc/shells,readonly \
--mount type=bind,src=/etc/passwd,dst=/etc/passwd,readonly \
--mount type=bind,src=/etc/shadow,dst=/etc/shadow,readonly \
--mount type=bind,src=/etc/asound.conf,dst=/etc/asound.conf,readonly \
\
--mount type=bind,src=/dev,dst=/dev \
--mount type=bind,src=/sys,dst=/sys \
--mount type=bind,src=/tmp,dst=/tmp \
\
--mount type=bind,src=/run/opengl-driver,dst=/opt/opengl-driver,readonly \
\
--mount type=bind,src=/nix,dst=/nix,readonly \
--mount type=bind,src=/run/current-system/sw/bin,dst=/run/current-system/sw/bin,readonly \
--mount type=bind,src=/etc/fonts,dst=/etc/fonts,readonly \
\
--mount type=bind,src=/tmp/.Xauthority,dst=/tmp/.Xauthority,readonly \
--mount type=bind,src=/run/user/$(id -u)/pulse,dst=/run/user/$(id -u)/pulse \
--mount type=bind,src=/run/user/$(id -u)/bus,dst=/run/user/$(id -u)/bus \
--mount type=bind,src=$HOME/.config/skk/SKK-JISYO.XL,dst=/tmp/SKK,readonly \
\
--mount type=bind,src=$state/vmware,dst=/etc/vmware \
--mount type=bind,src=$state/isoimages,dst=/usr/lib/vmware/isoimages \
--mount type=bind,src=$state/home,dst=/app \
\
--mount type=bind,src=/data/active,dst=/data/active \
--mount type=bind,src=/data/vm,dst=/data/vm \
--mount type=bind,src=/data/tmp,dst=/data/tmp \
--mount type=bind,src=$HOME/Downloads,dst=/data/downloads \
\
--env=DISPLAY=$DISPLAY \
--env=XAUTHORITY=/tmp/.Xauthority \
--env=LD_LIBRARY_PATH=/opt/opengl-driver \
--env=HOME=/app \
--env=DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS \
--env=SHELL=/bin/bash \
\
--entrypoint /run/current-system/sw/bin/zsh \
vmware-installed -c "chown $(id -un):$(id -gn) /app \
&& /usr/lib/vmware/bin/vmware-usbarbitrator \
&& (/usr/bin/vmware-networks --start &) \
&& sudo -u $(id -un) -g $(id -gn) ibus-daemon -dx \
&& (test -d /app/.config/dconf || sudo -u $(id -un) -g $(id -gn) dbus-launch ibus-setup) \
&& sudo -u $(id -un) -g $(id -gn) dbus-launch vmplayer
&& sudo -u $(id -un) -g $(id -gn) dbus-launch env GDK_SCALE=2 GDK_DPI_SCALE=0.5 vmplayer
"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment