---
# System prepended metadata

title: Build a VM and Docker Container on NodeWeaver SOP
tags: [' NodeWeaver', ' NFVI', Virtual Machine Manager]

---

---
tags: Virtual Machine Manager, NodeWeaver, NFVI
---
# Build a VM and Docker Container on NodeWeaver SOP
###### tags: `NodeWeaver`

## BIOS setting

enable SR-IOV and vSwitch

## install and enter nodeweaver (YiHao in charge of this part)

### install nodeweaver

1. Choose option 1 like picture below
![](https://i.imgur.com/399XV4C.png)

2. After step 1, you'll enter this login frame
   Default account: setup
   Default password: nodeweaver
![](https://i.imgur.com/4JF9orx.png)

3. After login, nodeweaver will search cluster automaticly, like picture below
   If there's cluster found, follow step 4-6
   else, follow step 7
![](https://i.imgur.com/P8YjuP0.png)

4. If there's cluster found, it will ask for join cluster or not, like picture below
![](https://i.imgur.com/GCrO1RZ.png)

5. Press space to choose the cluster, and it will add "*" mark, like picture below
   After that, choose "connect" option below
![](https://i.imgur.com/n9dTT3S.png)

6. After rebooting, it will show message like picture below, and it means node setted
![](https://i.imgur.com/pjMtfeq.png)

7. If there's no cluster found or creating a new cluster, it will show pictures below
   Type in label, IP address, netmask, default gateway and canary IP (fill in default gateway in canary IP column), after that, it will start processing after press enter
![](https://i.imgur.com/uYsbR9z.png)
![](https://i.imgur.com/DOATriH.png)
![](https://i.imgur.com/q54nQuE.png)
![](https://i.imgur.com/SG6lpaQ.png)

### enter nodeweaver webUI

1. Open web browser and type in IP address
   Default account: admin
   Default password: cloud
![](https://i.imgur.com/8yqqfQz.png)

### troubleshooting

When creating a new node (step 7 of install nodeweaver)
It should be finished in 10 minutes, or it may have problem
Please reboot and follow step 1 and step 2 of install nodeweaver part,
we'll show the frame like picture below, and we choose "Manage Options"
![](https://i.imgur.com/gPgbgZT.png)

After that, choose "Format" option and restart install nodeweaver procedure
![](https://i.imgur.com/H2bWLMy.png)

### caution

1. If you can, avoid using console, sometimes it occurs error (no output from console)

2. If stucked at procedure 7 of install nodeweaver, please follow troubleshooting and do, and it may takes more than 1 time to do that

## build VM

### create a net interface

1. Click Item on the menu of the left: Network => Virtual Networks

2. Click “+” button on the upper left side of the menu

![](https://i.imgur.com/zPmoNWZ.png)

3. Type Name of that Virtual Network Interface

![](https://i.imgur.com/Rk2k7aI.png)

4. Click Item on the menu of the top: Addresses

5. Type in first IP address, size (amount of VMs in the virtual internet) and first MAC

6. Click "Create" button

![](https://i.imgur.com/9A4kkf3.png)


### create a image which contains installing OS .iso file

1. Click Item on the menu of the left: Storage => Images

2. Click "+" button on the upper left side of the menu

![](https://i.imgur.com/Ocxg4r2.png)

3. Write name and select goal (about goal, I always choose HDD_2 option because there's no SSD on system)

4. Upload the .iso file from local

5. Click "Create" button

![](https://i.imgur.com/gyHhNKy.png)

### doing setting of VM

6. Click Item on the menu of the left: Templates => VMs

7. Click "+" button on the upper left side of the menu

![](https://i.imgur.com/V6wYlQt.png)

8. Type in Name, HW Resource (including Memory, CPU and VCPU) of VM

![](https://i.imgur.com/WH1UfjC.png)

9. Click Item on the menu of the top: Storage

10. Add a disk what you built with installing OS .iso

![](https://i.imgur.com/d2t1wkC.png)

11. Add a disk

12. Click "Volatile disk" option

13. Type in capacity of storage

![](https://i.imgur.com/abcveTJ.png)

14. Click Item on the menu of the top: Network

15. Choose a defined NIC interface

16. Click "Create" button on the upper left side

![](https://i.imgur.com/aeXbk4b.png)

17. Click Item on the menu of the left: Instances => VMs

18. Click "+" button on the upper left side of the menu

![](https://i.imgur.com/9tWhoHt.png)

19. Choose template of VM you built

### starting VM

20. Click "Create" button on the upper left side

![](https://i.imgur.com/CiTfLtN.png)

21. Click Item on the menu of the left: Instances => VMs

22. If VM was built successfully, it should show RUNNING on the column of Status, if the VM's running, click the monitor button at the rightside to the view of VM and install OS

![](https://i.imgur.com/Kk0jRmw.png)

### installing OS

23. After installing OS, poweroff your VM. After VM poweroffed, clicking your VM 

![](https://i.imgur.com/FClBKuH.png)

24. Click Item on the menu of the top: Storage

25. Detach the Vhd with installing OS .iso

![](https://i.imgur.com/VotM8m7.png)

## after installing OS

1. install ssh
```javascript=
$ sudo apt-get install ssh
```

2. attach the VM by ssh protocol

## transfer file to VM (VM must be poweroffed if use this method)

1. Click Item on the menu of the left: Storage => Images

2. Click "+" button on the upper left side of the menu

![](https://i.imgur.com/Ocxg4r2.png)

3. Write name and select goal (about goal, I always choose HDD_2 option because there's no SSD on system)

4. Choose Type: Generic storage datablock

5. Choose Advanced Options => BUS: SCSI(sd)

6. Pack file what you want to upload to a .iso file at local

7. Upload the .iso file from local 

8. Click "Create" button

![](https://i.imgur.com/tyYzdwy.png)

9. Click Item on the menu of the left: Instances => VMs

10. Click your VM

![](https://i.imgur.com/t1YY45U.png)

11. Click Item on the menu of the top: Storage

12. Click Attach disk button

![](https://i.imgur.com/t3tfvBf.png)

13. Choose disk that contains your file and click attach button

![](https://i.imgur.com/q81SWeO.png)

14. Boot VM

15. Mount the disk in the VM like you use Linux

## Build a Docker Container

After we built a VM, we can build a docker container on VM

We work on command line, so we can attach VM by NodeWeaver or SSH

### Install Docker Container on VM

source: https://docs.docker.com/engine/install/ubuntu/

```javascript=
$ sudo apt-get remove docker docker-engine docker.io containerd runc

$ sudo apt-get update

$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common
    
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -



$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

$ sudo apt-get update
 
$ sudo apt-get install docker-ce docker-ce-cli containerd.io

# reboot

```

### Pull docker images

I take ubuntu docker image for example

* search docker images

```javascript=
$ sudo docker search ubuntu //docker search [keyword]
```

* pull docker images from docker images library

```javascript=
$ sudo docker pull ubuntu //docker pull [image_Name]
```

* create docker container from docker image

```javascript=
$ sudo docker run -it ubuntu //docker run -it [image_Name]
```

* exit from container and close container
```javascript=
# exit
```
We can also use Ctrl+C

* exit container without close it
(Ctrl+P) and (Ctrl+Q)

## source
https://docs.nodeweaver.eu/#/
https://docs.docker.com/engine/install/ubuntu/

## special thanks
Rick Xiao
Kevin Chio
YiHao Shih