Linux commands not recognized in ChromeOS based Virtual Machine - virtual-machine

I have a Virtual Machine Instance on Google Cloud, which is set up using ChromeOS. The basic Linux commands such as apt, dpkg, etc are not recognized.
Is there a workaround how to enable "Linux beta" for ChromeOS from terminal, or another solution how can I be able to run any sort of apt-get commands?

There is no other choice rather than removing the ChromeOS-based machine and recreate a new one either debian or ubuntu.

Related

Mount VHDX within WSL Ubuntu 18.04 to edit Linux files

I'm looking to change a process (which currently is an elevated PowerShell script running in Windows 10, and I want to keep it close to that) I have that currently uses Paragon Linux Filesystem for Windows tool. While it does work, it doesn't work consistently. What I'd like to do instead is to use WSL on Windows 10, 1909 currently (will go to 2004 when available), to mount a VHDX which contains to partitions, /dev/sda1 for /boot, and /dev/sda2 another for an Linux LVM. The OS within this VHDX is CentOS 7.5, and the filesystem I want to modify is formatted in ext4. I need to edit some files within a logical volume within the group.
Currently, I'm running into an issue where qemu-nbd doesn't help, as there doesn't appear to be an NBD kernel mode driver provided by the Microsoft Linux kernel in Ubuntu 18.04 image from the Windows Store. I've tried guestfish (using guestmount), but it is unable to find an operating system and fails to mount any of the volumes.
Is this possible? Am I going down the wrong path, and is this not possible?
As I understand your question...
Seems to me that you want to offline access a .vhdx containing Linux
using powershell to manipulate some files...
(I think the issue here is ext4 and file rights)
1. Mount the .vhdx you want to '''work''' in a linux virtual machine as second disk
2. Install Powershell 7 in linux VM
3. Configure Powershell remote in the Linux VM (via SSH)
4. Access the Linux VM from Windows Powershell 7 and execute your scripts.
there are other ways using VMs+NBD or using WSL and mounted
drives... but this seems to be the most practical end efficient!
as you for sure know you can start/stop the VMs from Powershell

Connecting Visual Studio Code (VSCode) to VirtualBox VM

I've been using WSL to debug C in VSCode, using Ubuntu from the Windows Store.
However, because my school projects must be able to run on a provided Virtual Machine (Lubuntu, in this case), it would be of great help if I could debug my code on Windows, through a connection to the Virtual Machine.
I've failed to find any good tutorials on this, so I tried playing around with the ip addr show command and connecting to the resulting address using ssh, but to no avail.
What would be the best approach to achieve this?
Found the solution. In the VM settings, I needed to add a Network Host-only Adapter. From there, I installed openssh-server in my VM:
sudo apt-get install openssh-server openssh-client
Then, by calling ifconfig I got my VM's ip (enp0s8 interface) and connected to it via ssh.
Hopefully this helps anyone facing the same issue.

Can Vagrant suffice my requirement?

I have been looking out for ways to setup an automation environment and I found this application named Vagrant. I read the docs on the site, however I wanted to know from the experts out there if Vagrant with Oracle VirtualBox would suffice my needs.
I need to have a script that will call Vagrant to initialize a VM [The VM-Image is always the same - Windows Server 2008 R2]
I need to copy some of my project related files from a shared location onto the VM
Call a Batch file that will take care of test runs for me inside the VM
Once my test run is complete, This VM needs to be self destroyed/destructed.
Also, I would like to know if the Image be a custom .ISO file?
Sounds like Vagrant and VirtualBox will work for that scenario. Also, you might find that running commands in the VM using WinRM or SSH may be the easiest way to launch tests.
If you haven't already seen it, the blog post about Windows support in Vagrant 1.6 is informative: https://www.vagrantup.com/blog/feature-preview-vagrant-1-6-windows.html
Creating a VirtualBox/Vagrant base VM from an .iso should work, and you can then do all of your work using the VM from that point onward.
To get started, you might try these steps:
Create a VirtualBox VM from your Windows .iso, using the VirtualBox GUI or cmdline tools.
Once you have the VM in the state you want it, shut it down and package it as a vagrant box - for example, on a Mac that step looks like (where Win7x64 is the dir containing the VirtualBox VM):
cd ~/VirtualBox\ VMs
vagrant package --base Win7x64 --output win7x64_base.box
Once that finishes, tell vagrant about the new base box:
vagrant box add win7x64_base /path/to/win7_base.box
Then you can vagrant init/vagrant up the VM:
mkdir win7 && cd win7
vagrant init win7x64
vagrant up
To enable SSH access, I installed Cygwin in the VM and configured sshd. So, after launching you can SSH in by running vagrant ssh
Note that if there's no Windows user in the VM named 'vagrant', you can specify the SSH username to use with vagrant ssh by placing this in your Vagrantfile:
config.ssh.username = 'user1'
As mentioned above, WinRM is also an option for remotely running commands.
And Vagrant apparently has some convenience features to make it easy to RDP into the VM, but I haven't looked at that.

Can I use Kinect on a Mac?

Studying vision, I would like to play with the Microsoft Kinect.
Can I use it on my Mac?
I have not found any Library for Mac and fear virtualization on my laptop to use Linux.
I've accessed Kinect data on OSX using openframeworks and the ofxKinect addon (which uses libfreenect and libusb).
It's not the only option, just I've used and worked 'out of the box'.
Try downloading the Zigfu Dev Bundle for mac (http://www.zigfu.com) - that should get you up to speed with kinect development on mac.
Using Kinect on Mac is as easy as ordering Latte.
But there is also a lot of confusion on the Internet and sites that seem to be old and give you the wrong advice such as installing a separate sensor library in addition to OpenNI. Just go to the basic website and download SDK for your MAC:
http://www.openni.org/openni-sdk/
You might need to have prerequsities though I assume you have already installed them, such as:
sudo port install libtool
sudo port install doxygen
restart comp
sudo port install libusb-devel +universal
Troubleshooting:
"sudo rm -f /opt/local/lib/libusb-1.0.0.dylib"
"sudo port clean libusb"
"sudo port install libusb +universal"
No need to compile anything. You should be able to run ./Samples/Bin/SimpleViewer right away after you run sudo ./install.sh.The PROBLEM might be that you have already tried to run it unsuccessfully and put a camera in the wrong state. I have seen errors such as USB intercase cannot be set etc. as a side effect.
Running your code in Eclipse is a different story and may require a few extra steps and changing your Ubuntu code (using openni namespace, different includes, etc.)

Automate CentOS installation with VMware for testing

Is is possible to automate the installation of an OS using VMware or any other virtualization product?
One of our products consists of a customized version of CentOS that installs the OS and our application on a server. It's much like any CentOS/RHEL installation where you choose a mode that corresponds to different kickstart options, and then you choose your keyboard type. The rest of the installation is automatic.
What I'd like to have is an automated system that will create a new guest VM, boot it with the ISO image of our product, start the installation (including choosing the keyboard), wait for the reboot, and then launch a set of automated tests.
I know that there are plenty of ways to automate the creation of new VM guests from existing templates/images, and I know you can use the VIX API to interact with virtual machines, but the VIX API seems to require that VMware tools is already running (which won't be the case when you're booting from the CentOS install disk).
This answer (Automating VMWare or VirtualPC) indicates that you can script VMware to boot from an ISO that does an unattended installation, but I would really like to test the same process that our customers will be using.
Another option might be to use Xen's fully-virtualized mode and see if scripting it over the serial port will work.
TIA,
Jason
I have a very very similar question, it is on superuser:
https://superuser.com/questions/36047/moving-vmware-os-image-as-primary-os-on-a-system
You can also use VirtualBox instead of VMWare. The VirtualBox SDK allows you to directly control the keyboard, the mouse the serial port and the parallel port of the guest without the virtualbox guest tools installed.
Unfortunately it doesn't offer a text console interface but the serial port can be connected to a local pipe file and that can probably be worked with just as well.
This may not be exactly what you need:
I have done something similar with a Ubuntu-based install. We used preseeding (Debian's form of kickstart), to answer all the questions during the install - providing the preseed file and the installer via tftp.
In addition to the official Ubuntu mirror we added the apt-server with our own packages in the preseed file. We put a .deb version of vmware-tools on the apt-server and added it to the packages to be installed.
The .deb of vmware tools just contained the .tar.gz and a postinstall script that would extract it to /tmp and run the vmware install script (which has a switch to be run unnattended, so it does not ask any questions).
So after the reboot vmware-tools were up and running and we could use vix to script the rest (which was not very reliable).
If you should encounter problems with running vmware-config.pl during boot, you could make a custom package that just extracts the tools and an init script that installs them on first boot, disables itself and reboots.
Maybe you can use this strategy (replacing apt by yum, preseed by kickstart and tftp by a remastered iso). If you really need to test that your users choose a keyboard in the installer (which is not very different from kickstart) this would obviously not work for you..