Minimize the paging configuration, which by default will create a file “C:\pagefile.sys” the same size as your availble memory. Its important that the “\” be escaped with a “\”.
This command lists existing page files.
The following commands add and delete page files if you would like to move it to another drive. After creating it you can then set the initialSize and MaximumSize as stated above. Its important that the “\” be escaped with a “\”.
Turning hibernate mode off will remove the C:\hiberfil.sys file. You will still have sleep mode available.
Curious about how to efficiently build a workstation to work on a variety of projects using reliable repeatable processes? Then this post is for you. It is part 1 in a series that I will write about this topic.
There are a variety of hardware workstations that you may be using: a desktop, laptop, maybe two laptops. The OS on these computers could also be of different types: Windows (7,8), Mac OS X, or linux (RedHat,Centos,etc.). We can normalize (or make same) the process of working on projects across these profiles (hardware & OS) with a group of tools designed to work together efficiently. These are virtualization and bootstrap automation tools (or CLI). Two specific tools in these categories are VirtualBox and Vagrant. There are others, however these serve as working examples for this post. Both tools are open source and free. You can easily download and install them on all the before mentioned profiles (hardware & OS).
Now that you have the tools to create new virtual machines easily you still need to have base image. The base image is the OS of your choosing that you would like available for working on projects. You are not restricted to just one though, you may have multiple projects on different operating systems and you can have base images for each. I use a centos 7 minimum install base image often and it will work well for the purpose of this blog. The centos 7 minimum image is available to everyone from the online service Atlas. I’ve uploaded my base image there and made it available to the public. Atlas is built by Hashicorp, the same makers of Vagrant, additionally having built my own base image I can be confident in the reliability of it being accessible and working.
Now that we have identified tools and a base image. The only final necessary component to get my virtual machine running is to create a “Vagrantfile”. The file can be as simple as the following:
In the same directory as the before mentioned file. Simply run:
Once the output indicates successful completion the machine will be online and ready to be accessed using SSH. With a properly configured SSH client you will be able to access the virtual machine with the simple command:
In the next part in the series we will explore more features of the VagrantFile and configuring the Virtual Machine with Chef.
Use Atlas, a recently released product of Hashicorp, to host virtualbox images. I already created an account, which was easy and free. I’ve also created my first box “abrooke/centos-7” from the web GUI at atlas. However, I need to now create a “box” for vagrant to upload it after configuring a “virtualbox” provider in my new box’s configuration in Atlas and that is where the blog post is picking up the story…
Download a minimal ISO from centos.
Create a new VirtualBox VM and use the ISO to install centos.
Use “Nat” for the first network adapter.
Note the MAC address for later.
The minimal install doesn’t come with dhclient running, so no IP. So addition setup instructions:
List the interfaces with “nmcli d”
Set the disconnected interface to automatically connect with “nmtui”
Then finally restart the network “systemctl restart network”
Then follow the instructions for createing a base box and Virtual Box specifics:
Set root password to “vagrant”
Add “vagrant” user using command: “adduser vagrant”
Set “vagrant” password to “vagrant” using command: “passwd vagrant”
Give “vagrant” user sudo permissions:
Add to the file “vagrant ALL=(ALL) NOPASSWD: ALL”
Remove “requiretty” so that sudo can run without a tty.
Add insecure key to authorized_keys file of the vagrant user.
Install wget as root: “yum install wget”
Wget the public key from vagrant on github and put it in the “authorized_keys” file of the “vagrant” user in the “~/.ssh/” directory.
Package box in current working directory with “vagrant package –base [name of VM]”.
After the Vagrant box has been created, the testing of the box can be done by loading it into vagrant’s box list using:
“vagrant add box [box name] [box path from package process]
After testing the box, the box can be uploaded to Atlas. Then subsequently a “Vagrantfile” can be configured to use it. Then “vagrant up” will use the “Vagrantfile” and download the box from Atlas. If the box is private in Atlas, then “vagrant login” will be necessary.