  Virtfs FAQ
  Afra Ahmad
  v1.2, November 04 2000 - afra@prongs.org

  This FAQ may help you in answering some common problems/questions with
  Virtfs. Please make sure you have read the Virtfs User Guide before
  hand.
  ______________________________________________________________________

  Table of Contents


  1. The Template Directory

     1.1 Why do I need a template directory?
     1.2 How do I configure which files should be copied over from the main server to the template directory?

  2. Editing virt.conf

     2.1 I do not want my virtual servers within /virtual
     2.2 How and why should I edit the <Shell Commands> section?

  3. General Issues

     3.1 My servers do not pop up in Virtfs anymore.
     3.2 Everything is setup fine, but when I try FTP access is always denied.
     3.3 When using Dialog, my terminal settings are messed up.
     3.4 I run Redhat 6.x and some services (ie. pop mail, ftp) do not work!
     3.5 Everytime I try to run something on the virtual server, some library is not found.
     3.6 What does the error execvp mean?


  ______________________________________________________________________


  11..  TThhee TTeemmppllaattee DDiirreeccttoorryy

  This section explains the template directory and how to configure it
  using virt_template.pl and virt_template.conf.


  11..11..  WWhhyy ddoo II nneeeedd aa tteemmppllaattee ddiirreeccttoorryy??

  To save hard drive space and for better, faster execution Virtfs uses
  a template directory. This is explained more in the Virtfs User Guide
  but what this does is create a directory (/virtual/template) which
  contains system files copied over from the main server.

  Each time a virtual server is created, the files for the server are
  hhaarrdd lliinnkkeedd from the template directory.


  11..22..  tthhee tteemmppllaattee ddiirreeccttoorryy??  HHooww ddoo II ccoonnffiigguurree wwhhiicchh ffiilleess sshhoouulldd
  bbee ccooppiieedd oovveerr ffrroomm tthhee mmaaiinn sseerrvveerr ttoo

  Within the virt_template.conf you can edit which files should be
  copied over. Each directory has a list of files seperated by a single
  space. For example for the /etc/ directory:


       bin_files = ls echo bash cat hostname cp chgrp chown chmod tcsh grep gawk more sed \
       sleep pwd ping ps mkdir mail ln rmdir rm sh su tar touch vi fgrep




  Any other directories which are not listed can be copied over by
  editing the <<CCuussttoomm TTeemmppllaattee>> section of virt_template.pl. You can do
  this by using !!template. Similar to virt.conf, !!template represents
  the template directory path. For example, if you were to enter:


       cp -a /lib !!template
       cp -dp  /usr/lib/* !!template/usr/lib




  this translates to:


       cp -a /lib /virtual/template
       cp -dp /usr/lib/* /virtual/template/usr/lib




  (If you have set up /virtual/template as the template directory - the
  above example is in the default virt_template.conf)



  22..  EEddiittiinngg vviirrtt..ccoonnff

  This section explains some issues with the main Virtfs configuration
  file, virt.conf. The file itself is explained well, and self
  explanatory.


  22..11..  II ddoo nnoott wwaanntt mmyy vviirrttuuaall sseerrvveerrss wwiitthhiinn //vviirrttuuaall

  If you do not want the virtual servers to be copied over to the
  /virtual directory (which is does by default), change the value of
  Leading Virtual Directory to something else, ie. /vhome.


  22..22..  HHooww aanndd wwhhyy sshhoouulldd II eeddiitt tthhee <<SShheellll CCoommmmaannddss>> sseeccttiioonn??

  After creating a virtual server, Virtfs will run the shell commands
  you enter within the <Shell Commands> section. The values of !!virtual
  is the directory in which your virtual server resides. !!domain is the
  name of the virtual server (ie. vserver.com). For example:



       echo !!domain > !!virtual/etc/HOSTNAME




  translates to:


       echo vserver.com > /virtual/vserver.com/etc/HOSTNAME








  33..  GGeenneerraall IIssssuueess


  33..11..  MMyy sseerrvveerrss ddoo nnoott ppoopp uupp iinn VViirrttffss aannyymmoorree..

  This may have happened because of a corrupted servers.lists file.
  Simply run: _v_i_r_t_f_s _-_d_e_t_e_c_t and this should clear up the problem.



  33..22..  EEvveerryytthhiinngg iiss sseettuupp ffiinnee,, bbuutt wwhheenn II ttrryy FFTTPP aacccceessss iiss aallwwaayyss
  ddeenniieedd..

  First through Virtfs check to see if the server is enabled for FTP
  Service. You can do this from the _S_e_r_v_e_r _I_n_f_o_r_m_a_t_i_o_n choice within
  Virtfs.

  If everything is set and access is still denied, make sure you have
  copied over the important files that your ftp service needs. On a
  typical Linux system, these are /etc/ftpaccess and /etc/ftpusers. Copy
  these files over to the virtual server's /etc directory.

  To prevent this happening with each server, Virtfs can automatically
  copy the files over. All you have to do is edit virt.conf and point
  out where these files are. In the virt.conf file, I have:



       ftp files = /etc/ftpaccess /etc/ftpusers




  under the _S_y_s_t_e_m _C_o_n_f_i_g section.



  33..33..  WWhheenn uussiinngg DDiiaalloogg,, mmyy tteerrmmiinnaall sseettttiinnggss aarree mmeesssseedd uupp..

  This issue has come up with people using Redhat 6.1. If this is the
  case, I suggest you download a working version of dialog or Xdialog. A
  better dialog can be downloaded from here
  http://www.prongs.org/virtfs/dialog-0.6-16.i386.rpm.


  33..44..  II rruunn RReeddhhaatt 66..xx aanndd ssoommee sseerrvviicceess ((iiee.. ppoopp mmaaiill,, ffttpp)) ddoo nnoott
  wwoorrkk!!

  Most probably this error is a cause of missing libraries, particularly
  the libraries in /usr/kerberos/lib. Simply copy the whole directory to
  the template directory so all virtual servers can link to the
  directory in future.

  Then you may have to run ldconfig. By default Virtfs creates the
  configuration file for ldconfig in /etc/ld.so.conf. You can configure
  which directories are to be entered into /etc/ld.co.conf for each
  virtual server by editing the ldconfig libs value in /etc/virt.conf.

  To the value of ldconfig libs, simply add /usr/kerberos/lib (each
  directory is seperated with a space). Chroot to your virtual server
  and run ldconfig.





  33..55..  ffoouunndd..  EEvveerryyttiimmee II ttrryy ttoo rruunn ssoommeetthhiinngg oonn tthhee vviirrttuuaall sseerrvveerr,,
  ssoommee lliibbrraarryy iiss nnoott

  Very similar to the problem explained above. If a library is not found
  on your virtual server, find it on the mmaaiinn sseerrvveerr and copy it over
  the virtual server.

  To prevent this happening with each server, copy the libraries to the
  template directory, so in future your virtual servers will link to the
  libraries.

  As explained in the above question, alter your /etc/ld.so.conf if need
  be.


  33..66..  WWhhaatt ddooeess tthhee eerrrroorr eexxeeccvvpp mmeeaann??

  If you are trying to access a service on the virtual server and you
  notice that virtuald is dumping out the following error message in
  your logs:


       execvp failed: No such file or directory




  There is an error in trying to find the service for your virtual
  server. For example, if you are trying to ftp into the server using
  in.ftpd, make sure it is on the virtual server. Also make sure your
  entry in /etc/inetd.conf or /etc/xinetd.conf specifies the full path
  to this file.


































