how to simulate power off on linux physical machine? - simulate

already tried:
reboot
how to simulate linux power off on Physical machine
like reboot? any other?
linux

Did you try the easiest way?
sudo shutdown -h now

Related

How to make a transparent proxy on macOS with Docker instead of Virtualbox?

There is a github project VRouter which make Openwrt image as an vbox on macOS and routing the traffic to the NIC of the virtual machine as a transparent proxy. I would like to know that is it possible to do these things o with docker?
As fas as I know, docker for mac actually run inside a virtual machine on mac and there is no docker0 NIC on macOS. I found a project tuntaposx and a tuntap support shim installer for Docker for Mac docker-tuntap-osx which make it access docker container inside the virtual machine from macOS instead of publish ports possible. But What's the next step? I am quite confused about network issue. Can someone give me a hint about it?
Docker requires a Linux host to run. It's unlikely it will ever directly support MacOS, or Windows, without some kind of VM running.
Docker isn't a virtual machine. It uses various features of the Linux kernel to essentially simulate a virtual server, but it isn't actually doing full virtualization.

What is the linux version of docker for mac k8s mode?

On a Mac, Docker has a built in kubernetes mode that helps you set up a dev cluster in 1 click. Is there a way to do with with Docker-CE on my linux laptop? If not, what is the recommended approach (seems weird that this is actually easier on a mac or windows lol)
To get the current OS version, try kubectl get nodes -o wide
If you're looking to run a local Kubernetes cluster, you should use Minikube: https://kubernetes.io/docs/getting-started-guides/minikube/

Access a USB device (not a memory stick) in a Docker container from a macOS host

Is it possible to access a USB device (which is not a memory stick) in a Docker container?
I've come across the --—privileged and --device options which I guess would work if I had a Linux host, but they don't seem to work in macOS where USB devices don't show up in /dev.
It looks like docker-machine + VirtualBox is the way to go. I documented the steps I took in the blog post How to use a USB device in a Docker container on Mac.

Can I run Docker in a Virtual Machine?

I tried to run Docker on a virtual machine.
Host : MacBook
VM : Parallels Windows 7
And error occurs:
Is it possible?
If the VM is a Linux, you can do this without any problem - on Linux, the Docker is essentially a well-worked chroot. Thus, the Linux docker is not virtualization.
In the case of Windows, it is not so easy. Windows Docker internally uses Hyper-V to emulate the containers. Which means that you can only run, if you can use nested virtualization:
On your host machine runs a Windows VM
Inside your Windows VM, runs a HyperV
HyperV is managed by the docker installed on your virtual Windows.
I tried qemu/kvm, virtualbox and vmware player. I configured them deeply and strongly, I've hacked them, I did every possible to do. Only the last worked (VMWare).
There are significant speed costs, but it may be useful for development on Linux, and then trial-test on Windows configurations.
You will need a lot of ram. At least 16G. 32G is better. A relative useful configuration would be:
32GB physical RAM for the physical host
12GB virtual RAM for the Windows VM running on it
8GB virtual RAM inside the Windows VM for the HyperV Linux host.
Sometimes it will be a little bit buggy, but only your HyperV will crash out, your virtual Win, or your host machine won't. It is okay for testing a docker container on a Windows machine, what you've developed on a Linux. Don't create mission critical servers on this way. :-)
You're using Docker Machine in your Windows VM, which is actually going to create a Linux VM inside the Windows VM on your Mac. You can do that, but you need to enable nested virtualization - which I'm not sure you can do in Parallels 7.
Instead you can run Docker Machine on the Mac directly and use Parallels to create the Linux VM - which means Docker is running in a Linux VM on your Mac, and you don't need nested virtualization.
Or preferably use Docker for Mac if your OS supports it, it's the latest product and has much better host integration than Docker Machine.
If you would be using Windows 10/11 Pro or Enterprise and Hyper-V, then all you must do is to enable nested virtualization. On your host, just run (with your guest off):
> Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $true
Now you can start your guest and run Docker Desktop as normal.
According to Docker's terms I don't think it's allowed. Section 4.1(b)(vii) says you shall not "use the Service on virtual machines." For clarification, "'Service' refers to the applications, software (including any Open Source Software), products and services provided by Docker, including any beta or trial versions."
If I am reading this right, that means it's illegal to run Docker on any VM.
Worked perfectly fine. Base OS win 10 pro with VirtualBox Version: 6.1 and vagrant with ubuntu 20.04. Using vagrant box follow docker instructions. With vagrant public network no need for port forwarding all apps were accessible.
Previous persons comment is very concerning considering on Windows and Mac you run docker inside a virtual machine lul. Windows uses WSL2 and Mac uses an arm linux machine to manage its docker.
Also, you can run docker in a vm, but it must be linuxOS vm as windows 7 does not support docker.

getting to the files system of the Alpine linux which runs Docker-for-mac

I am playing with the (awesome) new Docker-for-mac. As I understand it, it runs seamlessly on my mac in an Alpine Linux 'behind the scenes'. Is there a way to ssh into this host so I can see the file system. I want to see the place that docker is storing volume data in /var/lib/docker/....
EDIT: to be clear, it is the host filesystem I want access to, not the containers that run on it. this is the Alpine host
thanks
Docker for Mac doesn't use regular tcp networking for ssh, but you can connect to the unix socket on your Mac by using:
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
and login as root
This seems to be fairly undocumented so YMMV - it worked for me on Version 1.12.0-rc3-beta18 -- it might change in future versions.

Resources