I am researching Ansible and am figuring out what is required to use it in a Windows only environment. I came across this link:
http://docs.ansible.com/intro_windows.html
and there it says that I need a Linux control machine.
I don't want to make it a requirement for customers who are Windows shops to setup and manage a Linux machine. So can I run a Linux VM on a Windows machine and use that as my control machine? I haven't tried this yet but wanted to know if there are any gotchas with this approach?
Yes, you could use a Linux VM to execute your Ansible playbooks. We did this for a coworker who ran Windows-only and it works fine as long as you configure the VM to be able to SSH into the Ansible-managed servers.
Yes it can be a VM but the best thing is to use virtualenv and install ansible inside the virtualenv, which is also true on Windows machine, I think as I am not Windows user. The main banefit is that you don't need to run the VM and give it the more resources. Hope that will help you. Thanks
Related
The software I build is written for windows and built on windows.
Right now I am in the process of finding a solution to isolate my build environments.
I am comparing two options - using virtual machines and using containers. I am also considering the issue of performance.
Unfortunately windows docker containers can only be run from windows.
Do windows containers run faster than windows virtual machines?
Does docker on windows use a virtual machine to host a windows container?
It completely depends on what you are trying to accomplish. Containerization and Virtualization have a lot in common but have different architectural designs. So you should rather try to invest some time and think about the things you want to do. Or you should specify your question and tell us what your main goal is.
Maybe you should check out this https://www.ibm.com/cloud/blog/containers-vs-vms and this https://www.edureka.co/blog/docker-for-windows/
My question is: If you use Docker tool box (that is required for windows 10 home to run Docker) you are essentially using a virtual machine (vm)?
If you are using a vm already the only reason to use docker from that point is to save on many more multiple instances?
Meaning if you only want 1 extra (guest instance): you can have a vm. Though, with docker (toolbox on windows 10 home) you would have 1 vm and it runs docker?
The only way that is useful is if you want many more instances as in: 1 vm + 1 docker or + 1000 more dockers?
Or am I missing something?
Yes, docker toolbox uses Oracle VirtualBox cause Windows 7, 8, and Windows 10 home cannot use Hyper V. And yes, If you are using a VM already the only reason to use docker from that point is to save on many more multiple instances but it also allows easy backup and deployment. But you are losing a decent amount of memory when running a VM and then even more when you are running docker.
So although Docker CE will tell you your Windows doesn't support Hyper-V, this isn't always the case (if you check in System Info you might have Hyper-V enabled, if you're on an Insider build or many builds on GPU computers after Anniversary update then you probably have Hyper-V on Windows 10 Home). There are a few workarounds until the Docker team addresses this issue.
You could use Docker from inside WSL (Windows Subsystem for Linux). Microsoft claims WSL accesses everything directly without Hyper-V so this should be theoretically at the same speed. Of course you can't use your GPU at all because of limitations with GPU passthrough on WSL, which you can ask to be resolved here.
You can also use Docker Toolbox as the other answer stated with Virtualbox, but this will be inherently much slower as you're virtualizing a container inside a virtualized container. You should be able to theoretically get GPU support through this, as well as other features e.g. GUI that you wouldn't be able to with WSL.
To answer the "usefulness" portion of the question:
It's also useful if you run code on a server, but need to develop/debug/update it. You want to test it locally, but to make sure the environment in which it executes is the same (to avoid unexpected, environment specific behavior), you use Docker both locally and on the server. In such a case, even though it's slow, I'll spin up a VM on my W10 Home laptop and run Docker in it.
The greatest feature of the Windows 10 Home May 2020 Update is Windows Subsystem for Linus 2. You can docker in it without the need for a complete virtual machine as in Virtual Box.
Install Docker Desktop that it will automatically indentify WSL2.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I was reading a nice question about docker - answer has overview of docker implementation details. I was wondering if anything like this is possible to do on Windows platform.
Do Windows alternatives for Docker exist?
Is it theoretically possible to use other (Windows based) components to build it?
Update1:
Slightly related question (sandboxing): Is there a lightweight, programmable Sandbox API for the Windows platform?
Update2::
For info how to install docker on windows (unrelated) - official docs has great instructions how to set up the environment by using boot2docker VM.
You can run docker in a virtual machine.
New Update
Vagrant has now integrated docker support. It can be used as provider or as provisioner. Here are some useful links.
Feature Preview: Docker-Based Development Environments
Vagrant Docs: Docker Provisioner
Vagrant Docs: Docker Provider
Old Update
As seanf pointed out in a comment below, Vagrant support was dropped. Instead they point to boot2docker:
boot2docker is a lightweight Linux distribution based on Tiny Core
Linux made specifically to run Docker containers. It runs completely
from RAM, weighs ~24MB and boots in ~5s (YMMV).
Old answer
The official docker documentation contains a small guide to install docker inside a Vagrant box. Vagrant is a great vm management wrapper. The guide is for Mac/Linux, but you get the idea to do the same in Windows:
http://docs.docker.io/en/latest/installation/vagrant/
This way you can share docker images across multiple systems with different operating systems.
If you're just searching for a way to deploy a pre-packaged set of applications in some sort of container for Windows, with registry and file access being virtualized but without using a full-blown virtual machine image, these (commercial) sandbox-like applications might be worth looking at:
Symantec Workspace Virtualization (get some ready-to-use packages from here)
Evalaze
Cameyo
BoxedApp
Edit: There's a new kid on the block, Spoon supports containers for Windows, and it actually looks very promising.
I have found that at least file system related functionality has Windows (7,8) already in place. One can use VHD files (virtual disks) for handling "images" concept in Docker. These image are used for virtual machine but can be created/attached/used directly by Windows too:
diskpart
DISKPART> create vdisk file=c:\base-image.vhd maximum=200 type=expandable
New image can be layered on top of base image:
DISKPART> create vdisk file=c:\image-2.vhd parent=c:\base-image.vhd
See more information about managing virtual disks.
Unfortunately, process lightweight isolation/sandboxing is probably not possible (at least not simple), although some methods do exists (http://www.sandboxie.com/, Native Client in Google Chrome ...)
Microsoft is working on their own Hyper-V Container that is similar to Docker - Azure also supports the Docker infrastructure.
That aside, it's hard to give precise alternatives but on the Windows side we've had App-V for quite a long time which virtualises and sand-boxes applications so they can be run or streamed without being actually installed on a specific system. I've never meddled with it but it seems to be able to run as a standalone client without any need of the intricate server infrastructure usually involved for anything Microsoft.
From another perspective the disk image format used by Windows (VHD) supports standard differencing so you can easily run many virtual machines from a single read-only OS image where each virtual machine have a tiny write image to handle the differences. These are still fullblown virtual machines though.
I currently don't know of any way to do the same thing on native windows as of right now.
I don't think the windows kernel was built for this sort of thing, so in order for it to be supported Microsoft would have to add the capabilities to the windows kernel. If I'm wrong, someone please correct me.
The most common way for people to do something like this is to use a VM in windows that runs a Linux based OS, and running everything inside of that. You could also do the same thing using FreeBSD (Jails), and Solaris (zones), if that is more your cup of tea. But Docker currently doesn't support FreeBSD or Solaris, so you will need to use the native tools for those.
Now you can run docker natively on windows
See http://docs.master.dockerproject.com/installation/windows/
And
http://azure.microsoft.com/blog/2015/04/16/docker-client-for-windows-is-now-available?Ocid=OutgoingPromotion_Social_TW_Azure_20150416_169251868&linkId=13596123
Starting in june 2016, Docker can be run on Microsoft's Hyper-V virtualization on Windows 10 hosts. This is now the preferred and "official" way to run Docker on Windows.
https://docs.docker.com/engine/installation/windows/
Hyper-V is a Type-1-Hypervisor, meaning docker will run one layer closer to the host hardware and perform significantly faster than boot2docker (which uses VirtualBox, a Type-2-Hypervisor, running inside the host OS).
The performance benefit for docker has a downside too: Enabling Hyper-V will prevent hardware virtualization features for Type-2-Hypervisors, therefore existing VirtualBox images can not be used with VTx, and you might want to consider moving other virtualized OSes to Hyper-V as well.
Windows 7-8.1 hosts can still use boot2docker to run Docker containers, but the main development focus for Docker on Windows is the "new" Hyper-V-Docker.
Hyper-V is only on Windows Pro. Install it for £110.
Or simply install Vagrant, install VirtualBox, install GIT bash, then from your GIT bash terminal.
git clone git#github.com:danday74/vagrant-docker-skelly.git
cd vagrant-docker-skelly
vagrant up # takes approx 5 mins to create VM
vagrant ssh
docker -v
docker-compose -v
The Vagrantfile shows that:
1 - this is a Xenial VM with docker and compose installed on it
2 - Ports mapped from Host to the VM are 9900-9920
3 - The shared folder is shared from host to VM
Tweak this as desired.
I got tired fighting with a maven docker plugin so I figured I would be able to fake it. This is how:
Using boot2docker and the following bat file makes it look like you're running docker natively. Place it on your path.
#set SSH="C:\Program Files (x86)\Git\bin\ssh.exe"
#set RUN_REMOTE='docker %*'
# %SSH% -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 2022 -i %HOMEPATH%/.ssh/id_boot2docker -tt docker#localhost %RUN_REMOTE%
The ssh.exe comes from the msys-git package which is bundled with boot2docker.
I'm pretty sure this solution have quite a few caveats, but it works pretty good for me.
Place this file on your path and bob's yer uncle.
I have three laptops(with ubuntu) that I am networking to act as a cluster for hadoop. I also have a windows only machine, is it possible to add that to the cluster and make it act as a node? Is it feasible? Has anyone come across such an issue?
If you have windows environment, I would suggest that you use VirtualBox and any Linux as Guest OS.
You can build your Hadoop cluster on that. There are numerous installation procedures available for Linux and you can't go wrong with that.
We are using it exactly this way for development purposes. Performance of Hadoop cluster is not a concern as is the functionality.
It also allows you to fine tune your dev ops since you can tear apart and start afresh with a new VM.
Easiest approach to build this way is to :
Install VirtualBox
Install Vagrant
Use a community provided box from: http://www.vagrantbox.es/
Bootstrap your VM for yum packages
Move from NAT interface to Bridged Ethernet interface
Install Hadoop using SCM: http://www.cloudera.com/products-services/tools/
Bring up your cluster
Yes it is possible. On the ubuntu machines, Hadoop installation should be straightforward, you just need to follow the regular steps. Since Hadoop runs on Linux environment, you need to install Cygwin on your windows Machine which is a Linux-like environment for Windows, and will enable you to install and run Linux-based applications (like hadoop) on a Windows machine.
Here is the link for Cygwin Installation: http://www.cygwin.com/install.html
I've bought a new notebook yet I'm not sure whether Linux fully supports it or not, so I decided to use a VM for the time being. The only virtualization software I've used so far is VirtualBox on linux, but I think it's a bit overkill for my needs.
All I need is to use it like a vps hosted on my machine. Command line access would be enough. It'd be nice if it's free/opensource and it's easy to configure.
Thanks.
VirtualBox + VBoxHeadless + Ubuntu Server edition works for me, I access it with winSCP/Putty and I don't have performance issue on notebook.
The Vagrant utility seems to be specifically designed to make it easy to do this. It requires you to have VirtualBox installed, but manages the configuration etc. You also could use the free VMWare Player and one of the ready-made VM images for it.