1. Download CentOS image
2. Follow steps here to install CentOS (
https://www.google.com/search?q=install+centos+on+hyper-v&rlz=1C1GCEB_enDE854DE854&oq=install+centos+on+hyper&aqs=chrome.0.0j69i57j0l4.3911j0j9&sourceid=chrome&ie=UTF-8 )
- Download CentOS ISO from
https://www.centos.org/download/
- In Hyper-V Manager select New / Virtual Machine…
- Click Next on the Before You Begin page
- Enter Name
- Click Next
- Select Generation 1 If you don't you will not be able to mount the ISO for Cent-OS
- Click Next
- Enter 512
- Click Next
- Connect to the same external network with internet access used for your Windows VM
- Click Next
- Select Create a virtual hard disk
- Click Next
- Select Install an operating system from bootable CD/DVD-ROM
- Select Image file (.iso)
- Browse to CentOS iso.
- Click Next
- Click Finish
With the VM created it is now time to install the OS.
- Right-Click VM
- Select Start
- Double-click VM
- Select Install CentOS 7
- Press Enter
- Select English / English (United States)
- Click Continue
- Click Installation Destination
- Click Done
- Click Network & Host Name
- Make sure that you choose to have the full installation with GNOME option
- Click toggle to turn on
- Click Done
- Click Begin Installation
- Click Root Password
- Enter Root Password
- Enter Confirm
- Click Done
- Click User Creation
- Enter Full name
- Enter User name
- Check Make this user administrator
- Enter Password
- Enter Confirm password
- Click Done
- Click Reboot
Your server is now installed and ready for use.
To connect the VM to the internet
1. Click start
2. Hyper V manager
3. Actions -> Virtual Switch Manager
4. Highlight external -> Create Virtual Switch
5. Give it a name
6. Highlight external network -> choose the network adapter
In the VM
1. Click File-> Settings
2. Go to Network Adapter tab
3. Choose the Virtual switch created
4. Make sure "Enable virtual LAN" is unchecked
5. In the VM go to settings and choose wired connection
Install Docker
reference
Uninstall old versions
Older versions of Docker were called docker
or docker-engine
. If these are installed, uninstall them, along with associated dependencies.
$ sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
It’s OK if yum
reports that none of these packages are installed.
Install required packages. yum-utils
provides the yum-config-manager
utility, and device-mapper-persistent-data
and lvm2
are required by the devicemapper
storage driver.
$ sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
Use the following command to set up the stable repository.
$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
Install the latest version of Docker Engine - Community and containerd, or go to the next step to install a specific version:
$ sudo yum install docker-ce docker-ce-cli containerd.io
If prompted to accept the GPG key, verify that the fingerprint matches060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
, and if so, accept it.
Start Docker.
$ sudo systemctl start docker
Verify that Docker Engine - Community is installed correctly by running the hello-world
image.
$ sudo docker run hello-world
To add current user to avoid sudo each time docker runs
sudo usermod -aG docker $USER
Most current Linux distributions (RHEL, CentOS, Fedora, Ubuntu 16.04 and higher) use
systemd
to manage which services start when the system boots. Ubuntu 14.10 and below use
upstart
.
systemd
$ sudo systemctl enable docker
To disable this behavior, use disable
instead.
$ sudo systemctl disable docker
Start manually
Once Docker is installed, you need to start the Docker daemon. Most Linux distributions use systemctl
to start services. If you do not have systemctl
, use the service
command.
systemctl
:
$ sudo systemctl start docker
service
:
$ sudo service docker start