diff --git a/scripts/runqemu b/scripts/runqemu
index 2c126e7f54..2de69dcd7c 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -227,6 +227,7 @@ class BaseConfig(object):
         self.qmp = None
         self.guest_agent = False
         self.guest_agent_sockpath = '/tmp/qga.sock'
+        self.instance_id = None
 
     def acquire_taplock(self, error=True):
         logger.debug("Acquiring lockfile %s..." % self.taplock)
@@ -1111,8 +1112,11 @@ to your build configuration.
         self.nfs_running = True
 
     def setup_cmd(self):
+        self.instance_id = str(int(time.time()))
+
         cmd = self.get('QB_SETUP_CMD')
         if cmd != '':
+            cmd = cmd.replace('@INSTANCE_ID@', self.instance_id)
             logger.info('Running setup command %s' % str(cmd))
             if subprocess.call(cmd, shell=True) != 0:
                 raise RunQemuError('Failed to run %s' % str(cmd))
@@ -1623,6 +1627,8 @@ to your build configuration.
         if self.bios:
             self.qemu_opt += " -bios %s" % self.bios
 
+        self.qemu_opt = self.qemu_opt.replace("@INSTANCE_ID@", self.instance_id)
+
         cmd = "%s %s" % (self.qemu_opt, kernel_opts)
         cmds = shlex.split(cmd)
         logger.info('Running %s\n' % cmd)
@@ -1647,6 +1653,7 @@ to your build configuration.
     def cleanup_cmd(self):
         cmd = self.get('QB_CLEANUP_CMD')
         if cmd != '':
+            cmd = cmd.replace('@INSTANCE_ID@', self.instance_id)
             logger.info('Running cleanup command %s' % str(cmd))
             if subprocess.call(cmd, shell=True) != 0:
                 raise RunQemuError('Failed to run %s' % str(cmd))
