How can I ensure HGFS in CentOS via Vagrant? - centos

I am using Vagrant (1.7.4) with the VMware Fusion provider.
I have created a new VM from the centos/7 box, and configured shared folders in my Vagrantfile.
On startup, I get the message
HGFS was never found on the running virtual machine. This must be
installed either through VMware tools or Open VM Tools. HGFS is
required for shared folders to work properly. Please install either
the VMware tools or Open VM Tools and try again.
after a while, and the system starts up, but without the mounted shared volume.
I have tried installing Open VM tools, with a
sudo yum -y install open-vm-tools
in my Vagrant provisioner inline shell script
config.vm.provision "shell", inline: <<-SHELL
sudo yum -y update
sudo yum -y install open-vm-tools
SHELL
However, I still get the message at startup, and I do not see the mounted share.
I have an almost identical Ubuntu box (precise/64) that seems to work just fine.

I looked up the box https://atlas.hashicorp.com/centos/boxes/7 and from the release notes they clearly mention that virtual box guest are not installed
The VirtualBox Guest Additions are not preinstalled; if you need them for shared folders, please install the vagrant-vbguest plugin. We recommend using NFS instead of VirtualBox shared folders if possible.
I think what they should mention is that they did not install the VMWare tools neither so default sharing folder with VMWare does not work.
How to install the VMWare tools for the VM
Make sure to mount a cd
Open VMWare Fusion and make sure the VM is down - open the VM settings, select the hard drive and add a device, select the CDRom.
boot the VM from the VM menu select Install VMWare Tools
Installing VMWare Tools
login to the VM (either from VMWare or open an ssh session with vagrant ssh)
Install pre-requisites and update kernel (at least I had to run to successfully install the VMWare tools on VMWare fusion 8.0 - see here)
sudo yum install perl gcc gcc-c++ make binutils
sudo yum update kernel
reboot and run the following again
sudo yum install kernel-headers kernel-PAE-devel
mount the VMWare tools
this is found from the VMWare doc - Make sure to run the below commands with root or add sudo
To create a mount point, run:
mkdir /mnt/cdrom
To mount the CDROM, run:
mount /dev/cdrom /mnt/cdrom
To copy the Compiler gzip tar file to a temporary local directory, run:
cp /mnt/cdrom/VMwareTools-<version>.tar.gz /tmp/
Where version is the VMware Tools package version. To determine the version of VMware tools, run:
ls /mnt/cdrom
You see output similar to:
VMwareTools-5.0.0-12124.tar.gz
To change to the tmp directory and extract the contents of the tar file into a new directory called vmware-tools-distrib, run:
cd /tmp
tar -zxvf VMwareTools-version.tar.gz
To change directory to vmware-tools-distrib and run the vmware-install.pl PERL script to install VMware Tools, run:
cd vmware-tools-distrib
./vmware-install.pl
After all this, the tools were installed and shared folder is working correctly.
as a side note I can say that its much easier building a box with packer and install the tools directly from install. There are plenty of packer templates available on github for all versions of centos.

Related

Installing jupyter lab on RHEL 7

I install jupyterlab on RHEL 7 (RedHat) with
pip3 install jupyterlab
Now I am trying to start it. I need to run it only locally (no need to open any ports). I found where file is located, but still cannot launch it. I tried jupyterlab and got back command not found.... I am guessing I need to add it to PATH, but I still expect it to run when launched from the same directory. Whatever limited experience I have with Ubuntu, does not work on RedHat.

Can't install powershell in Parallels Kali Linux Virtual Machine

I've been trying to install Powershell for a few hours now. I run this under root:
apt update && apt -y install powershell
This is what I end up getting after it runs through and seemingly downloads
Package powershell is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'powershell' has no installation candidate
When I try to run this same command outside of root using sudo, I get the following:
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
I have updated everything and tried a few different ways. I even downloaded a completely new Virtual Machine in Parallels to see if restarting would help out. I still run into the same problems. This is a Kali Linux VM on Parallels MacOS M1. Not sure if that matters or not. I think Parallels itself may possibly be using an apt process in the background, but when I do:
sudo killall apt apt-get
I end up getting
apt: no process found
apt-get: no process found
I've been trying everything. I'm on a new Mac so I don't have too many VM options. If someone could figure this out in Parallels, it would be a great help.
I've tried a lot. In the description above.
To install PowerShell in Kali Linux open the terminal and type:
sudo apt update
sudo apt install -y snapd # install daemon and tooling that enable snap packages
sudo systemctl enable --now snapd apparmor
Log out and back in again, and run the following command to install the powershell snap package.
sudo snap install powershell --classic

Install packages during uck Ubuntu customization

I am following the steps from this website to customize my Ubuntu image. After unpacking the clean .iso I add some files to the "remaster" and also I would like to install some apps (wireshark for example), so when the systems boots with the custom image, there is no need to install anything. I run the following script:
sudo uck-remaster-clean
sudo uck-remaster-unpack-iso my.iso
sudo uck-remaster-unpack-rootfs
// .. add desired files to the remaster
sudo apt-get install wireshark
sudo uck-remaster-pack-rootfs -c
sudo uck-remaster-pack-iso -g myNew.iso
However, wireshark is installed on the machine on which I am running the script, not in the remaster-root system. What do I need to modify to have the apps installed on the unpacked ISO? Is it even possible?
You skipped a step, you need to sudo uck-remaster-chroot-rootfs before.
Now you can install packages with apt-get and perform all kinds of customizations.

Netbeans can't add remote host running on Virtualbox

I installed Ubuntu Server 15 on VirtualBox 5.0.10 and set up ssh access to the guest using NAT/port forwarding (host:3022->guest:22). The host is Windows 7 64bit.
I can successfully access the Ubuntu server via putty or other ssh client from an external computer (not the host). But NetBeans 8.0.2 can't complete adding the remote host. It just freezes on "Connecting ip_addr:3022..." stage (authentication type is 'Password')
What can be the reason? How can I resolve it?
It seems like the reason is that com-jcraft-jsch.jar distributed with NetBeans 8.0.2 doesn't work with OpenSSH 6.9 distributed with Ubuntu 15. There is a workaround for this, but unfortunately it doesn't work with OpenSSH 6.9.
I was able to resolve the issue after I downloaded and built OpenSSH-5.4 (requires zlib-dev, libssl-dev and some other packages). To use existant ssh config files you need to configure OpenSSH properly before build:
./configure --sysconfdir=/etc/ssh
make
sudo make install
Please note that make install will install binaries in /usr/local/bin, configuration files in /usr/local/etc, the server in /usr/local/sbin, etc. To specify a different installation prefix, use the --prefix option to configure.
You may need to modify /etc/ssh/sshd_config file (at least to point to sftp-server) and you may want to modify /etc/init.d/ssh, but anyway, OpenSSH-5.4 does work with NetBeans 8.0.2.
UPD: NetBeans 8.0.2 also works correctly with OpenSSH 6.6.1

How do I install the Matlab MCR in Ubuntu 14.04 without "killing" Unity?

Background: I have created an Ubuntu VirtualBox from LAPP stack and added the Ubuntu desktop (Unity: sudo apt-get install ubuntu-desktop). Now I am attempting to install the MCR without loosing Unity.
Download MCR zip and extract to MCR_SOURCE
Go to my folder that contains the files: cd /media/sf_shared/MCR_ SOURCE
Change installer_input.txt file:
destinationFolder=/opt/MCR
agreeToLicense=yes
outputFile=/opt/install.log
mode=silent
product.MATLAB
product.MATLAB_Builder_JA
# Note: To find out the required toolboxes >> start Matlab >> run your code and find out which toolboxes were used with: license('inuse')
Install MCR: sudo ./install -inputFile /media/sf_shared/MCR_SOURCE/installer_input.txt >> success
Restart Ubuntu >> test whether Ubuntu’s Unity still exists >> everything is fine
Attention the next step will “ kill ” your Ubuntu desktop configuration!!! (i.e. copy your hardisk, anything you must do to recover quickly) – now configure: sudo gedit /etc/environment
LD_LIBRARY_PATH="/opt/MCR/v84/runtime/glnxa64:/opt/MCR/v84/bin/glnxa64:/opt/MCR/v84/sys/os/glnxa64:${LD_LIBRARY_PATH}"
XAPPLRESDIR="/opt/MCR/v84/X11/app-defaults"
# Note: X11/app-defaults folder has not been created during installation
Restart Ubuntu >> Unity is gone, recovery attempts such as deleting the above lines do not recover Unity; reinstalling the Ubuntu desktop does not help either.
I have tried an alternative route with exporting the variables, which also "kills" Unity. By the way this affects all users.
Any ideas?
It is not necessary to register these environment variables in /etc/environment, which means that the Unity sidebar will not be affected.
Instead register the environment variables temporarily either as local user or via sudo -i:
export LD_LIBRARY_PATH="/opt/MCR/v84/runtime/glnxa64:/opt/MCR/v84/bin/glnxa64:/opt/MCR/v84/sys/os/glnxa64:${LD_LIBRARY_PATH}"
export XAPPLRESDIR="/opt/MCR/v84/X11/app-defaults"
Now it is possible to run Matlab Apps without "killing" Ubuntu's desktop. For instance to run the Java compiled makesqr.m file.
java -classpath "/opt/MCR/v84/toolbox/javabuilder/jar/javabuilder.jar:/media/sf_shared/for_testing/makesqr.jar" makesqr.Class1 5
The Java package makesqr was created using Matlab's JavaBuilder tutorial. This was done on my Windows 7 machine, which runs Matlab R2014b.
Please ensure that the owner and permissions of the /opt/MCR and /media/sf_shared/for_testing folders are set correctly (see here for details).