Ubuntu – VMWare Virtual Machine thesql / apache services not working the same after a VM copy

apache-2.2MySQLUbuntuvirtual-machinesvmware-workstation

I have Ubuntu server running in a VMWare 6.5.2 virtual machine. I made a straight file copy of the entire VM folder structure to my laptop from my desktop and then booted it up.

After the VM guest OS boots, things are a little wonky. In particular, mysql won't start, and all my localhost'd files come up 404, even the root index.

Any ideas?

Edit – To clarify, I copied the Virtual Machine files located in the Host Windows computer's file system from my Desktop computer to my Laptop computer, and then opened the copied files in VMware on the laptop.

Here are the mysql error logs from syslog:

Jul 23 11:51:03 ubuntu mysqld_safe[9194]: started
Jul 23 11:51:03 ubuntu mysqld[9197]: 090723 11:51:03  InnoDB: Started; log sequence number 0 8539038
Jul 23 11:51:03 ubuntu mysqld[9197]: 090723 11:51:03 [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address
Jul 23 11:51:03 ubuntu mysqld[9197]: 090723 11:51:03 [ERROR] Do you already have another mysqld server running on port: 3306 ?
Jul 23 11:51:03 ubuntu mysqld[9197]: 090723 11:51:03 [ERROR] Aborting
Jul 23 11:51:03 ubuntu mysqld[9197]: 
Jul 23 11:51:03 ubuntu mysqld[9197]: 090723 11:51:03  InnoDB: Starting shutdown...
Jul 23 11:51:04 ubuntu mysqld[9197]: 090723 11:51:04  InnoDB: Shutdown completed; log sequence number 0 8539038
Jul 23 11:51:04 ubuntu mysqld[9197]: 090723 11:51:04 [Note] /usr/sbin/mysqld: Shutdown complete
Jul 23 11:51:04 ubuntu mysqld[9197]: 
Jul 23 11:51:04 ubuntu mysqld_safe[9218]: ended
Jul 23 11:51:17 ubuntu /etc/init.d/mysql[9360]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Jul 23 11:51:17 ubuntu /etc/init.d/mysql[9360]: ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
Jul 23 11:51:17 ubuntu /etc/init.d/mysql[9360]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Jul 23 11:51:17 ubuntu /etc/init.d/mysql[9360]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Jul 23 11:51:17 ubuntu /etc/init.d/mysql[9360]: 

Here are the apache error logs. Regardless of what localhost url I try to open, the same error line is output:

[Thu Jul 23 11:57:38 2009] [error] [client 127.0.0.1] File does not exist: /htdocs
[Thu Jul 23 11:59:53 2009] [error] [client 127.0.0.1] File does not exist: /htdocs
[Thu Jul 23 11:59:59 2009] [error] [client 127.0.0.1] File does not exist: /htdocs
[Thu Jul 23 12:00:04 2009] [error] [client 127.0.0.1] File does not exist: /htdocs

Best Answer

This could be an issue with udev...., The name of the ethernet card is based upon the mac address of the interface. If the mac address has changed ( which I would expect if it is a new machine with copied discs ) then the working ethernet cards would have new names, and the old ones which are configured would no longer exist/come up.

Showing the output of /sbin/ifconfig will help show one way or another. The contents of /etc/network/interfaces and /etc/hosts would be interesting

Related Topic