Call us Toll-Free:
1-800-218-1525
Email us
This nifty one-liner will count the number of unique visitors in an NGinx web-server access.log file, for a given day:

grep "\[04/Nov/2009" access.log | cut -d" " -f1 | sort | uniq | wc -l

Replace 04/Nov/2009 with the date you'd like to count the number of unique visitors for.

FreeBSD No Ports Fix

Mike Peters, November 4
When installing a FreeBSD system, you're asked if you would like to install the Ports Collection. If you chose no, you can follow these instructions to obtain the ports collection:

Option 1 - CVSup

csup -L 2 -h cvsup.FreeBSD.org /usr/share/examples/cvsup/ports-supfile
csup

Option 2 - Portsnap

portsnap fetch
portsnap extract
When you have production web servers and databases, it is absolutely critical to have a monitoring system in-place that will alert you whenever service goes down.

Getting Started with website monitoring

One of our favorite monitoring tools is Pingdom. It's a $9.95/month easy-to-use service that will ping 5 of your servers, once every 60 seconds, alerting you via email & SMS whenever any server goes down.

In addition to downtime notifications, the service also provides response-time trends, raw data and uptime-over-time reports:



If you don't have any monitoring in-place right one, you should definitely try out Pingdom or a similar service.

In about 5 minutes of setting it up, you'll have the peace of mind, knowing exactly when your merchant website, affiliate landing page or payment gateway goes down.

Beyond simple HTTP monitoring

While Pingdom and other similar tools are great in letting you know once your website is -already- down, a lot of times the outage can be prevented in the first place, by detecting a decrease available memory, cpu, disk space etc.

At the pinnacle of server monitoring are tools such as Nagios and Munin.

Munin will monitor every single resource on your server, including: memory, cpu utilization, available handles, open connections, average load, running processes and more.

Nagios sends alerts to groups of users based on predetermined rules.



Do It Yourself Server Monitoring

In this post, I'd like to focus on how to create a simple monitoring script, that will survey remote servers for a few critical metrics, displaying the results on the screen.

Unlike Nagios+Munin, such a setup doesn't require installing a monitoring component on each server. Your monitoring script can run remotely, surveying all servers once every 60 seconds on a cronjob, sending an email/sms whenever detecting abnormal behavior.

For the purpose of this example, our script will monitor the following metrics:

= MySQL Database server
* Number of running threads
* Number of threads connected
* Queries per second
* Open tables
* Sample query response
* Number of tables in database

= Any FreeBSD/Linux server
* CPU load over the last 5 minutes
* Available memory
* Open sockets
* Number of running processes


// Set these for easier access
$USERNAME  = "root";
$SERVER  = "www.mydomain.com";
$DBHOST    = "www.mydatabase.com";
$DBUSER    = "root";
$DBPASS    = "dbpassword";
$DBNAME    = "dbdatabasename";

// Get load average, available memory and number of running processes
$load_average = "N/A";
$available_memory = "N/A";
$running_processes = "N/A";
$CRLF = "\\r\"\n";
exec("ssh -l$USERNAME $SERVER \"top -b -n 1\"",&$buf);
for (
$i=0,$str=""; $i<count($buf); $i++) $str .= $buf[$i].$CRLF;
if ((
$pos=strpos($str,"load averages:"))!==false)
{
   
$str = trim(substr($str, $pos+strlen("load averages:")));
    if ((
$pos=strpos($str,$CRLF))!==false)
    {
       
$load_average = substr($str,0,$pos);
        if ((
$pos=strpos($str,"up"))!==false) $load_average = substr($load_average,0,$pos);
    }
}
else
if ((
$pos=strpos($str,"load average:"))!==false)
{
   
$str = trim(substr($str, $pos+strlen("load average:")));
    if ((
$pos=strpos($str,$CRLF))!==false)
    {
       
$load_average = substr($str,0,$pos);
    }
}
if ((
$pos=strpos($str,"processes:"))!==false)
{
 
$str = trim(substr($str, $pos+strlen("processes:")));
  if ((
$pos=strpos($str,","))!==false)
  {
   
$running_processes = substr($str,0,$pos);
  }
}
else
if ((
$pos=strpos($str,"Tasks:"))!==false)
{
   
$str = trim(substr($str, $pos+strlen("Tasks:")));
    if ((
$pos=strpos($str,","))!==false)
   
$str = trim(substr($str, $pos+1));
    if ((
$pos=strpos($str,"run"))!==false)
    {
       
$running_processes = substr($str,0,$pos);
    }
}
if ((
$pos=strpos($str,"Mem:"))!==false)
{
 
$str = trim(substr($str, $pos+strlen("Mem:")));
  if ((
$pos=strpos($str,$CRLF))!==false)
  {
   
$available_memory = substr($str, 0, $pos);
  }
}

// Get open sockets
$open_sockets = "N/A";
$buf = array();
exec("ssh -l$USERNAME $SERVER "netstat -n | wc -l"",&$buf); 
$open_sockets = trim($buf[0]);     

// Display server metrics
echo "== Server\r\n";
echo
"    Load average: $load_average\r\n";
echo
"    Open Sockets: $open_sockets\r\n";
echo
" Running Processes: $running_processes\r\n";
echo
"  Available memory: $available_memory\r\n";
echo
"\\r\"\n";

// Get running and connected threads
$db_threads_connected = "N/A";
$db_running_threads = "N/A";
mysql_connect($DBHOST,$DBUSER,$DBPASS);
$Result = @mysql_query("show status like '%thread%' ");
$cnt = @mysql_num_rows($Result);
while (
$cnt)

   
$cnt--;
    if (!(
$Row = @mysql_fetch_array($Result))) continue;

    if (empty(
$Row['Value'])) continue;

    if (
Strcasecmp($Row['Variable_name'],'Threads_connected')==0)
   
$db_threads_connected = $Row['Value'];
    else
    if (
Strcasecmp($Row['Variable_name'],'Threads_running')==0)
   
$db_running_threads = $Row['Value'];
}

// Get queries per second
$Result = @mysql_query("show status like 'questions' ");
$Row = @mysql_fetch_array($Result);
$questions = $Row['Value']+0;
$Result = @mysql_query("show status like 'uptime' ");
$Row = @mysql_fetch_array($Result);
$uptime = $Row['Value']+0;
$db_queries_per_second = number_format($questions/$uptime,0);

// Get open tables
$db_open_tables = "N/A";
$Result = @mysql_query("show status like '%tables%' ");
$cnt = @mysql_num_rows($Result);
while (
$cnt)
{
   
$cnt--;
    if (!(
$Row = @mysql_fetch_array($Result))) continue;

    if (empty(
$Row['Value'])) continue;
    if (
Strcasecmp($Row['Variable_name'],'Open_tables')==0)
   
$db_open_tables = $Row['Value'];
}

// Get query response
$Result = @mysql_query("SELECT 1");
$Row = @mysql_fetch_row($Result);
$db_query_response = $Row[0]=='1' ? "Good" : "BAD";

// Get total number of tables
@mysql_query("use $DBNAME");
$Result = @mysql_query("show tables");
$db_tables_in_database = @mysql_num_rows($Result);

// Display database metrics
echo "== Database\r\n";
echo
"  Running Threads: $db_running_threads\r\n";
echo
" Threads Connected: $db_threads_connected\r\n";
echo
" Queries Per Second: $db_queries_per_second\r\n";
echo
"    Open Tables: $db_open_tables\r\n";
echo
"  Query Response: $db_query_response\r\n";
echo
"  Number of tables: $db_tables_in_database\r\n";

The output of the script will look something like this:

== Server
Load average: 0.09, 0.23, 0.23
Open Sockets: 226
Running Processes: 1 running
Available memory: 2203M Active, 112M Buf, 4668K Free

== Database
Running Threads: 3
Threads Connected: 16
Queries Per Second: 320
Open Tables: 200
Query Response: Good
Number of tables: 1648

Tip: If you're looking to monitor dozens of servers, consider applying our ssh no password approach, to save the hassle of having to exchange private keys with each server.
We all know that one can configure SSH to login automatically by adding the client's public key to the server's ~/.ssh/authorized_keys file. But what if you need to run commands on 200 machines and don't want to login to every single machine to add the key? Search no more, this tutorial has the answer!

1. Installing sshpass

sshpass is a tool for non-interactivly performing password authentication with SSH's so called "interactive keyboard password authentication".

Here's a standard SSH connect command:

debian_I:~# ssh -l root localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
RSA key fingerprint is b4:e9:e7:56:a2:b4:89:9b:d8:fd:7e:8e:f1:e4:1d:9f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
root@localhost's password:
Last login: Thu Oct 8 09:35:41 2009 from localhost
Linux debian_I 2.6.18-6-686 #1 SMP i686
debian_I:~#

First you have to answer "yes" to accept the host key and then to enter the password.

With sshpass, you are able to specify the password on the command line and skip this step. Here's how to install it:

mkdir -p /usr/local/src/
cd /usr/local/src/
wget http://downloads.sourceforge.net/project/sshpass/sshpass/1.04/sshpass-1.04.tar.gz?use_mirror=iweb
tar xvfz sshpass-1.04.tar.gz
cd sshpass-1.04
./configure
make
make install

sshpass is now ready to be used!

2. Using sshpass

The sshpass' syntax is:

sshpass -p [password] [ssh command]

So instead of doing:

ssh -l root localhost

You can simply do:

sshpass -p myrootpass ssh -l root localhost

You will be automatically logged in, without any password prompt:

debian_I:~# sshpass -p myrootpass ssh -l root localhost
Last login: Thu Oct 8 09:52:04 2009 from localhost
Linux debian_I 2.6.18-6-686 #1 SMP i686
debian_I:~#

3. Automatically accepting host keys

The last problem is this prompt:

The authenticity of host 'localhost (127.0.0.1)' can't be established.
RSA key fingerprint is b4:e9:e7:56:a2:b4:89:9b:d8:fd:7e:8e:f1:e4:1d:9f.
Are you sure you want to continue connecting (yes/no)? yes

When you're using sshpass to connect on a single machine that you use often, it's not a big deal because you will get the prompt once and never again after. But if you want to connect to 200 machines, you definitely don't want to type "yes" 200 times.

To fix this issue, simply add this line in /etc/ssh/ssh_config on the CLIENT machine:

StrictHostKeyChecking=no

With this setting enabled, SSH will automatically accept the host keys and will not prompt you about it.

4. Automating the process

This section will show you how to easily automate the process of running commands on any number of machines you want.

First you will need a file containing the hostname, username and password for each of the servers you want to run commands on, in a CSV format. For example:

ssh_magic.csv:
someserver.com,root,123456
someotherserver.com,sshadmin,abcdef
onelastserver.com,root,123456

Then you will create this bash script:

ssh_magic.sh:
#!/bin/sh

# Loop ssh_magic.csv
for LINE in $(cat ssh_magic.csv)
do
   
# Split line
   
host=$(echo $LINE | cut -d "," -f1)
   
user=$(echo $LINE | cut -d "," -f2)
   
pass=$(echo $LINE | cut -d "," -f3)
   
   
# Display server info
   
echo ""
   
echo "HOSTNAME: $host"
   
echo ""
   
   
# Run commands
   
sshpass -p $pass ssh -l $user $host "uname -a"
   
sshpass -p $pass ssh -l $user $host "df -h"
   
   
echo ""
   
echo "===================================="
done

echo ""
echo "DONE"
echo ""

Simply place ssh_magic.csv and ssh_magic.sh together and run the script.

Conclusion

You now know how to run commands on any number of SSH machines, without any prompt! Make sure you check the other ways to pass the password to sshpass - they offer more secure ways than directly on the command line with the -p option.

How to install basic Squid on FreeBSD

Michel Nadeau, October 2
Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. Squid has extensive access controls and makes a great server accelerator. It runs on most available operating systems, including Windows and is licensed under the GNU GPL.

This tutorial describes how to install a very simple implementation of Squid on your network.

1. Getting started

The first thing you want to do is to download Squid. In this tutorial, we're going to work in the /usr/local/src directory.

$ mkdir -p /usr/local/src
$ cd /usr/local/src
$ wget http://www.squid-cache.org/Versions/v3/3.0/squid-3.0.STABLE19.tar.gz

Then you want to extract Squid and change to its directory:

$ tar xvfz squid-3.0.STABLE19.tar.gz
$ cd squid-3.0.STABLE19

We're now ready to compile and install Squid!

2. Compiling/installing Squid

Compiling and installing Squid is very easy:

$ ./configure --prefix=/usr/local/squid
$ make all
$ make install

If the configure command fails because you don't have Perl, you can simply install it like this:

$ pkg_add -r perl

Then re-run the configure command.

3. Configuring Squid

First of all, you need to add the "visible_hostname" setting in your Squid configuration file. The main configuration file is:

/usr/local/squid/etc/squid.conf

Open it with your favorite editor and find this block:

# TAG: visible_hostname

At the end of the block (before the next "TAG" block), insert a new line and put something like this:

visible_hostname freebsd

Replace "freebsd" with any hostname you want Squid to use - it can be a local hostname or a fully qualified domain name. Save the file.

Now you need to adjust some permissions before Squid can be initialized...

$ mkdir -p /usr/local/squid/var/logs/
$ chmod 777 /usr/local/squid/var/logs/

$ mkdir -p /usr/local/squid/var/cache/
$ chmod 777 /usr/local/squid/var/cache/

Squid can now be initialized. Use this command:

/usr/local/squid/sbin/squid -z

Squid is now ready to run!

4. Starting/stopping Squid

Starting Squid:

/usr/local/squid/sbin/squid

Stopping Squid:

kill -9 `cat /usr/local/squid/var/logs/squid.pid`

You can start Squid automatically at boot time by creating the /usr/local/etc/rc.d/squid.sh file with this content:

#!/bin/sh
/usr/local/squid/sbin/squid

You also need to allow execution of this file:

$ chmod 755 /usr/local/etc/rc.d/squid.sh

5. Using Squid with your browser

To use Squid with your browser, you simply need to set it as a proxy in your browser's settings. Squid is listening on TCP port 3128. So if your FreeBSD machine's IP is 1.2.3.4, you will configure your proxy to be 1.2.3.4, port 3128.

Once configured, all the traffic over the chosen protocols (usually your browser lets you choose for which protocols you want to use a proxy) will go through your Squid server.

6. "Overriding" Web sites addresses

The first place where Squid is looking when it comes to resolving URL's to IP addresses is in the /etc/hosts file. If you want to "override" Web sites addresses, simply add them in the /etc/hosts file along with the IP address where you want to redirect traffic.

For example, let's say that you want your Squid's users to be sent to 1.2.3.4 when they request www.google.com instead of to the real google.com. To do so, you will add this line in your /etc/hosts file:

1.2.3.4 google.com www.google.com

Replace "1.2.3.4" with the IP of the machine where you want to redirect traffic. This isn't really a "redirect" as the users will never see 1.2.3.4 in their browser. For them, it will look like just as if they were really on www.google.com, not on 1.2.3.4.

NOTE: you NEED to restart Squid when you make changes in /etc/hosts.

Conclusion

Squid is very simple to install and use. Though, it's also VERY powerful and flexible: it has literally thousands of options! This tutorial only covered the very basic use - refer to the Squid users guide if you want to customize squid.conf.

Resources

* Squid
* Configuration guide
* Configuration examples
* Users guide
This weekend we converted all SPI mutlihomed hosting email mailboxes from the mbox format to maildir.

What is the difference between mbox and maildir?

Mbox is the traditional way of storing mail messages in the Unix world. In this format, a regular text file which serves as the mail user's mailbox file is created.

Pros: Format is universally supported, Appending a new mail into the mailbox file is fast, Searching text inside a single mailbox file is fast.

Cons: Has file locking problems, Has problems when used with network file systems, Format is prone to corruption.

Maildir is a new way of storing mail messages. In this format, a directory usually named Maildir is created for each mail user. Under this directory are three more directories named new, cur and tmp.

Pros: Locating, retrieving and deleting a specific mail is fast, Minimal to no file locking needed, Immune to mailbox corruption (assuming the hardware will not fail).

Cons: Some filesystems may not efficiently handle a large number of small files, Searching text, which requires all mail files to be opened is slow.

Why we chose Maildir

We've decided to upgrade to Maildir because its more reliable (entire mailbox never fully corrupts) and thanks to no locking it is noticeably much faster to access your mail over Maildir.

Ongoing mbox file locking issues were driving us nuts.

SPI is using the Dovecot mail server on all machines. Dovecot is one of the highest performing IMAP servers. Luckily it supports both mbox and maildir, so all we had to do was: Convert old email messages from mbox to maildir.

Mb2md

Mb2md is a Perl script that takes one or more Mbox format mailbox files in a directory and convert them to Maildir format mailboxes.

Replace USERNAME below with the unix username whose mailbox you are converting

Step 1: Set environment variables for Mb2md

setenv MAIL /var/mail/USERNAME

Step 2: Convert the inbox folder and create Maildir folder

sudo -u USERNAME mb2md -m

Step 3: Convert other folders the user created

sudo -u USERNAME mb2md -s /home/USERNAME/mail/ -R

Step 4: Copy IMAP subscriptions

cp /home/USERNAME/mail/.subscriptions /home/USERNAME/Maildir/subscriptions

Step 5: Tell sendmail to deliver new mail to the user's /Maildir

cd /home/USERNAME
echo '"|IFS='"' '"' && exec /usr/local/bin/procmail -f || exit 75 #YOUR EMAIL NAME"' >> .forward
chmod 644 .forward
echo "DEFAULT="'$'"HOME/Maildir/" >> .procmailrc
chmod 644 .procmailrc
chown USERNAME:USERNAME .forward
chown USERNAME:USERNAME .procmailrc

Step 6: Delete old mbox files

rm /var/mail/USERNAME
rm -fdr /home/USERNAME/mail

Testing & Troubleshooting

To test, use sendmail to send a test message to your user:

sendmail USEREMAIL
subject: Test, please ignore

This is a test
.

If all works well, your email message will be delivered to the user's Maildir.

If you see the mail appended to /var/mail/USERNAME (do a tail -f /var/mail/USERNAME), this means sendmail is failing to invoke .procmailrc and deliver the email message to Maildir.

This is usually due to the /home or /home/USERNAME folders not having the correct file permissions.

Run this command to troubleshoot:

sendmail -v -Am -d11 USERNAME < /dev/null
In a recent post, we explained how to run FreeBSD on Windows using VirtualBox. Today we will show you how to achieve the same thing but using VMware Server. VirtualBox is a very nice application: it's fast, simple and lightweight; but VMware Server has some very interesting features to offer:

* It can run any number of virtual machines in the background. You don't need to keep any window opened and you can simply access your virtual machines using SSH if you wish.

* It supports any guest operating system, including 64-bit versions.

* All the administration is done via a great Web interface.

As VirtualBox, VMware Server is also 100% free. Another product that is competing VMware Server, and that is also free, is Microsoft VirtualServer. It has the same features but is harder to install, harder to use and is a lot more fragile. After months of testing, VMware Server proved to be the best on performance, stability and usability.

1. Download VMware Server

The first step is obviously to download VMware Server. Go there: http://www.vmware.com/products/server/ and click on the "Download" button on the left. You will need to register to download the software. Once you're registered and logged in, copy the "VMware Server 2 for Windows" serial number displayed in the "Licensing" section of the page and paste it somewhere - you will need it later. Then grab the "VMware Server 2" EXE image under the "Binaries" section. The file is around 500MB.

2. Install VMware Server

Installing VMware Server is very straightforward: basically, you simply run the setup file and hit next, next, next, next... without changing anything. There's no real options except which shortcuts you want to create.

At the end of the setup, you will be asked to enter your serial number. Because of the virtual network adapters VMware Server installs, you will also be required to reboot: you need to do it immediately if you want to go further in this tutorial.

3. Download FreeBSD

In this tutorial, we'll be installing FreeBSD 7.2 minimal. If you have a 64-bit CPU, download this one (amd64 release):

ftp://ftp.freebsd.org/pub/FreeBSD/re...md64-disc1.iso

If you have a 32-bit CPU, download this one (i386 release):

ftp://ftp.freebsd.org/pub/FreeBSD/re...i386-disc1.iso

The ISO file is around 600MB.

4. Create the FreeBSD Virtual Machine

Start the VMware Server Web Access using the Start Menu shortcut (called "Web Access") or use your favorite browser and go to this URL: http://127.0.0.1:8308/ui/

Log into the VMware Server Web Access using your Windows account.

The first thing to do is to add a Datastore to your VMware Server configuration. To do so, click on your machine name on the left panel and click on the "Add Datastore" link on the right panel. The Datastore is a folder where everything about virtual machines will get created and stored. Simply give it a name and specify the directory (example: name: VM, directory: d:\VM).

Click on the "Create Virtual Machine" on the right panel:

* Name the virtual machine "FreeBSD", select the Datastore you've just created and hit next.

* Choose "Other operating systems", choose "FreeBSD" (32 or 64-bit, depending on your CPU) in the combo box and hit next.

* Assign the amount of memory you want your virtual machine to have (usually the recommended amount is quite good, unless you need a high-performance virtual machine). If you have a multi-core CPU (or many CPU's), you can choose the number of CPU's you want your virtual machine to use. Hit next when you're satisfied with your settings.

* Select "Create a New Virtual Disk" and hit next.

* Choose the size you want your virtual disk to have and hit next.

* Select "Add a Network Adapter" and hit next.

* Leave the settings to "Bridged" and hit next.

* In the CD/DVD section, select "Use an ISO Image" and hit next.

* Move the FreeBSD 7.2 ISO image you've just downloaded somewhere under the directory you're using as your Datastore. Then select it and hit OK. Then hit next.

* Select "Don't Add a Floppy Drive"

* Select "Don't Add a USB Controller"

* Check "Power on your new virtual machine now" and Hit "Finish"

5. Installing FreeBSD

Now that your FreeBSD virtual machine is created, it's time to install FreeBSD! First of all, in the VMware Server Web Access, click on the FreeBSD virtual machine on the left panel. Then click on the "Console" tab on the right, and click anywhere in the black screen. A small console window will popup: that's your FreeBSD machine, just like if you were sitting in front of a computer running FreeBSD.

NOTE: the console window "steals the focus"; at any time, press CTRL+ALT to release focus from this window. And simply click into the console window to use it.

It should boot from the ISO image you've specified in the setup: it's now time to install FreeBSD:

* Choose "United States" and hit enter.

* Choose "Standard" and hit enter.

* In the Disk Geometry screen, hit "a", then "q".

* Choose "BootMgr" and hit enter.

* In the Partition screen, hit "a", then "q".

* In the "Choose Distributions" screen, select "Minimal" and hit space to check it. Then hit tab, then enter on the OK button.

* Choose CD/DVD and hit enter. The base system will install.

* Network:

Hit "yes" to configure network.
Choose the "em0" network interface.
Hit "yes" to configure using DHCP.
Enter an hostname and hit enter many times.
Choose "no" to use this machine as a gateway.
Hit "no" to enable inetd.
Hit "yes" to enable SSH.
Hit "no" to anonymous FTP.
Hit "no" to NFS server.
Hit "no" to NFS client.

* Last settings:

Hit "no" to customize console.
Hit "yes" to timezone and choose your timezone.
Hit "no" to PS/2.
Hit "no" to package collection.
Hit "no" to create a user.
Set the "root" password.
Hit "no" to visit the options menu.

At the main menu, hit tab to go to the "Exit Install" option, hit enter and then hit "yes". Close the console. In the VMware Server Web Access, select the FreeBSD Virtual Machine on the left panel and hit the red "stop" sign at the top. Then hit the green "play" sign and return in the console. Your FreeBSD system should boot normally.

6. Mounting a shared folder using Samba

It's very convenient to be able to easily and quickly share files between your Windows and FreeBSD machine.

First of all, share a folder on your Windows machine (ex: share). It can be any folder, just share it normally. Then choose a mount point for that folder on your FreeBSD (ex: /mnt/share). We're now going to configure your FreeBSD machine so the shared folder will be automatically mounted at boot time.

Here's the sample informations (replace with yours):

Windows machine: win
Windows IP addr: 192.168.0.100
Windows share: share
Windows user: administrator
Windows password: mypass
FreeBSD mount point: /mnt/share (do not forget to create the directory!)

In /etc/nsmb.conf, add:
NOTE: the caps are important

[WIN]
addr=192.168.0.100

[WIN:ADMINISTRATOR]
password=mypass

Then in /etc/fstab, add:

//administrator@win/share /mnt/share smbfs rw 0 0

NOTE: before rebooting FreeBSD to test, I recommend testing the mounting manually with a command like this:

mkdir -p /mnt/tmp
mount_smbfs //administrator@win/share /mnt/tmp

Finally, reboot your FreeBSD machine and then go check in your mount point (like /mnt/share) if it works! Try creating folders from FreeBSD and from Windows and verify if it's working correctly. If it's not, the problem is probably on the authentication side.

7. Starting the virtual machine automatically

One other great VMware Server feature is the ability to start virtual machines automatically when you boot Windows.

To configure this, in the VMware Server Web Access, click on your Windows machine name on the left panel, and then click on "Edit Virtual Machine Startup/Shutdown Settings". Select your FreeBSD virtual machine and click "Move Up" to put it in the "Any Order" category.

Conclusion

You now have a FreeBSD virtual machine, acting just like if it was a real server sitting somewhere in your house! Virtual machines are great for development and testing. Please let me know if you have any problems getting this tutorial working!
« Previous Posts



About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions