You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: '#90DaysOfDevOps - The Big Picture: DevOps and Linux - Day 14'
2
+
title: '#90DaysOfDevOps - 概览: DevOps 与 Linux - 第十四天'
3
3
published: false
4
-
description: 90DaysOfDevOps - The Big Picture DevOps and Linux
4
+
description: 90DaysOfDevOps - 概览: DevOps 与 Linux
5
5
tags: 'devops, 90daysofdevops, learning'
6
6
cover_image: null
7
7
canonical_url: null
8
8
id: 1049033
9
9
---
10
-
## The Big Picture: DevOps and Linux
11
-
Linux and DevOps share very similar cultures and perspectives; both are focused on customization and scalability. Both of these aspects of Linux are of particular importance for DevOps.
A lot of technologies start on Linux, especially if they are related to software development or managing infrastructure.
13
+
许多技术都是从Linux开始的,特别是当它们与软件开发或基础设施管理有关的时候。
14
14
15
-
As well lots of open source projects, especially DevOps tools, were designed to run on Linux from the start.
15
+
此外,许多开源项目,尤其是DevOps工具,从一开始就被设计为在Linux上运行。
16
16
17
-
From a DevOps perspective or in fact any operations role perspective you are going to come across Linux I would say mostly. There is a place for WinOps but the majority of the time you are going to be administering and deploying Linux servers.
I have been using Linux on a daily basis for a number of years but my go to desktop machine has always been either macOS or Windows. However, when I moved into the Cloud Native role I am in now I took the plunge to make sure that my laptop was fully Linux based and my daily driver, whilst I still needed Windows for work-based applications and a lot of my audio and video gear does not run on Linux I was forcing myself to run a Linux desktop full time to get a better grasp of a lot of the things we are going to touch on over the next 7 days.
I am not suggesting you do the same as me by any stretch as there are easier options and less destructive but I will say taking that full-time step forces you to learn faster on how to make things work on Linux.
23
-
24
-
For the majority of these 7 days, I am actually going to deploy a Virtual Machine in Virtual Box on my Windows machine. I am also going to deploy a desktop version of a Linux distribution, whereas a lot of the Linux servers you will be administering will likely be servers that come with no GUI and everything is shell-based. However, as I said at the start a lot of the tools that we covered throughout this whole 90 days started out on Linux I would also strongly encourage you to take the dive into running that Linux Desktop for that learning experience as well.
25
-
26
-
27
-
28
-
For the rest of this post, we are going to concentrate on getting a Ubuntu Desktop virtual machine up and running in our Virtual Box environment. Now we could just download [Virtual Box](https://www.virtualbox.org/) and grab the latest [Ubuntu ISO](https://ubuntu.com/download) from the sites linked and go ahead and build out our desktop environment but that wouldn't be very DevOps of us, would it?
Another good reason to use most Linux distributions is that they are free and open-source. We are also choosing Ubuntu as it is probably the most widely used distribution deployed not thinking about mobile devices and enterprise RedHat Enterprise servers. I might be wrong there but with CentOS and the history there I bet Ubuntu is high on the list and it's super simple.
Vagrant is a CLI utility that manages the lifecycle of your virtual machines. We can use vagrant to spin up and down virtual machines across many different platforms including vSphere, Hyper-v, Virtual Box and also Docker. It does have other providers but we will stick with that we are using Virtual Box here so we are good to go.
41
-
42
-
43
-
44
-
The first thing we need to do is get Vagrant installed on our machine, when you go to the downloads page you will see all the operating systems listed for your choice. [HashiCorp Vagrant](https://www.vagrantup.com/downloads) I am using Windows so I grabbed the binary for my system and went ahead and installed this to my system.
45
-
46
-
47
-
48
-
Next up we also need to get [Virtual Box](https://www.virtualbox.org/wiki/Downloads) installed. Again this can also be installed on many different operating systems again a good reason to choose this and vagrant is that if you are running Windows, macOS, or Linux then we have you covered here.
49
-
50
-
51
-
52
-
Both installations are pretty straightforward. If you have issues both have great communities around them also feel free to reach out and I can try to assist also.
53
-
54
-
55
-
56
-
## Our first VAGRANTFILE
57
-
58
-
59
-
60
-
The VAGRANTFILE describes the type of machine we want to deploy. It also defines how we want the configuration and provisioning of this machine need to look.
When it comes to saving these and organizing your VAGRANTFILEs I tend to put them in their own folders in my workspace. You can see below how this looks on my system. Hopefully following this you will play around with Vagrant and see the ease of spinning up different systems, it is also great for that rabbit hole is known as distro hopping for Linux Desktops.
Let's take a look at that VAGRANTFILE then and see what we are building.
73
-
51
+
让我们看一下VAGRANT文件,看看我们正在构建什么。
74
52
75
53
76
54
```
@@ -93,12 +71,9 @@ end
93
71
94
72
```
95
73
96
-
This is a very simple VAGRANTFILE overall we are saying we want a specific "box" a box being possibly either a public image or private build of the system you are looking for. You can find a long list of "boxes" publicly available here in the [public catalog of Vagrant boxes](https://app.vagrantup.com/boxes/search)
97
-
98
-
99
-
100
-
Next line we are saying we want to use a specific provider in this case it is `VirtualBox` and then we want to define our machine's memory to `8GB and our number of CPUs to `4`. My experience also tells me that you may want to also add the following line if you experience display issues. This will set the video memory to what you want, I would ramp this right up to `128MB but depends on your system.
74
+
总的来说,这是一个非常简单的VAGRANTFILE。我们想要一个特定的“盒子”,一个盒子可能是您正在寻找的系统的公共映像或私有版本。您可以在[public catalog of Vagrant boxes](https://app.vagrantup.com/boxes/search) 中找到一系列公开的“盒子”。
I have also placed a copy of this specific vagrant file in the [Linux Folder](Linux/VAGRANTFILE)
111
-
112
-
113
-
114
-
## Provisioning our Linux Desktop
115
-
116
-
117
-
118
-
We are now ready to get our first machine up and running, in your workstations terminal. In my case I am using PowerShell on my Windows machine, navigate to your projects folder and where you will find your VAGRANTFILE. Once there you can type the command `vagrant up` and if everything is correct then you will see something like the below.
Another thing to add here is that the network will be set to `NAT` on your virtual machine, at this stage we don't really need to know about NAT and I plan to have a whole session talking about in the next section about Networking. But know that it is the easy button when it comes to getting a machine on your home network, it is also the default networking mode on Virtual Box. You can find out more in the [Virtual Box documentation](https://www.virtualbox.org/manual/ch06.html#network_nat)
This is where we will do most of our exploring over the next few days but I also want to dive into some customizations for your developer workstation that I have done and it makes your life much simpler when running this as your daily driver, and of course, are you really in DevOps unless you have a cool nonstandard terminal?
107
+
在Virtual Box中进行确认,您应该会在选择VM时看到登录提示。
139
108
140
109
110
+

141
111
142
-
But just to confirm in Virtual Box you should see the login prompt when you select your VM.
143
-
144
-
145
-
146
-

147
-
148
-
149
-
150
-
Oh and if you made it this far and you have been asking "WHAT IS THE USERNAME & PASSWORD?"
151
-
152
-
112
+
如果你做到了这一步,你会问“用户名和密码是什么?”
153
113
154
114
- Username = vagrant
155
115
156
116
- Password = vagrant
157
117
118
+
明天我们将了解一些命令以及它们的作用,终端将成为实现一切的地方。
158
119
159
-
160
-
Tomorrow we are going to get into some of the commands and what they do, The terminal is going to be the place to make everything happen.
161
-
162
-
## Resources
120
+
## 相关资料
163
121
164
122
-[Learn the Linux Fundamentals - Part 1](https://www.youtube.com/watch?v=kPylihJRG70)
165
123
-[Linux for hackers (don't worry you don't need be a hacker!)](https://www.youtube.com/watch?v=VbEx7B_PTOE)
166
124
167
-
There are going to be lots of resources I find as we go through and much like the Go resources I am generally going to be keeping them to FREE content so we can all partake and learn here.
0 commit comments