1.2 How Virtfs works

There are quite a few methods used for virtual servers, however Virtfs takes advantage of the system's chroot features. What chroot does is set any given directory on your filesystem to a root directory. For example, chroot can set /home/user to the / directory (although if you try it now, it may not work complaining that a shell could not be found).

By copying the main files (and directory structure) from the main server to a specific location, we create a template of what each virtual server consists of. Then, for each virtual server you want to create, we link them to the template that we created. This saves drive space as well as organizing everything.

But how does the process of Virtual Servers actually occur? If we create a virtual server (say, vserver.com) in the directory, /virtual/vserver.com, we chroot to /virtual/vserver.com and everything is set up as a virtual server. Upon executing chroot on /virtual/vserver.com, the /etc directory will in fact be /virtual/vserver.com/etc and not /etc (as we know it on the main server). So, if a client edited vserver's /etc/passwd file, it will in no way be affecting the main server's passwd file. The client will be editing their /etc/passwd file but in reality they are editing /virtual/vserver.com/etc/passwd. To them, when they are editing /etc/passwd, they are actually editing /virtual/vserver.com/etc/passwd on the main server.

In addition to this, once you are within a virtual server, you cannot see the files belonging to the main server. Therefore a client would not be able to see another client's filesystem, or even the main server. To them, their virtual server is their "main" server, and they cannot see beyond that.

Services (ie. FTP, E-mail, Samba, etc..) for each virtual system will run individually from one another, and even from the main system.